/**
 *    author:  wxhtzdy
 *    created: 18.12.2022 10:09:22
**/
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);  
  int n, m;
  cin >> n >> m;
  if (n == 1) {
    cout << m << '\n';
    return 0;
  }
  if (m == 1) {
    cout << n << '\n';
    return 0;
  }
  cout << 2LL * (n + m - 2) + (n - 2) * 1LL * (m - 2) / 2 << '\n';                                            
  return 0;
}