#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define int long long
#define pb push_back
#define all(x) x.begin(), x.end()

const int maxn = 1e6 + 5;
const int mod = 1e9 + 7;

int rec(int a, int b) {
  if (b <= 0 || a <= 0) return 0;
  if (a == 1 && b == 1) return 1;
  if (b == 1 && a % 2 == 0) return a * b + rec(a/2, b) * 2;
  if (b == 1 && a % 2) return a * b + rec(a / 2, b) + rec(a - a/2, b);
  if (b % 2 == 0) return a * b + rec(a, b/2) * 2;
  return a * b + rec(a, b/2) + rec(a, b - b/2);
}

signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
  
  int a, b;
  cin >> a >> b;
  cout << rec(a, b);
}
