#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define per(i,a,b) for (int i = a; i >= b; i--)
#define pii pair<int,int>
#define fi first
#define se second
#define endl '\n'
#define pb push_back
#define all(v) (v).begin(), (v).end()
const int MAXN = 5e5+10;
const int INF = 1e18+10;
const int MOD = 1e9+7;
string add(string a, string b) {
int carry = 0;
string res;
while(a.size()>0 && b.size() > 0) {
int cur = (a.back()-'0') + (b.back()-'0')+carry;
res += cur%10+'0';
carry = cur/10;
a.pop_back();
b.pop_back();
}
if(a.size()==0) swap(a,b);
while (a.size()>0) {
int cur = a.back()-'0'+carry;
carry = cur/10;
res+=cur%10+'0';
a.pop_back();
}
if(carry) res+="1";
reverse(all(res));
return res;
}
string half(string a) {
string res;
int carry = 0;
for(char &x : a) {
int val = 10*carry + (x-'0');
if(res.size()>0 || val/2!=0) res += (val/2)+'0';
carry = val%2;
}
if(res.empty()) return "0";
return res;
}
string mul(string a, string b) {
string ans = "0";
while(b!="0") {
if((b.back()-'0')%2==1) ans = add(ans,a);
b = half(b);
a = add(a,a);
}
return ans;
}
void solve() {
int n,m; cin >> n >> m;
string a,b; cin >> a >> b;
cout << mul(a,b) << endl;
}
int32_t main() {
ios_base::sync_with_stdio(0);cin.tie(nullptr);
int tt = 1;
//cin >> tt;
while(tt--) solve();
}