#include <stdio.h>
int main() {
  long n, m;
  scanf("%ld%ld", &n, &m);
  long min;
  if (n == 1 || m == 1)
    min = m * n;
  else
    min = (n + m - 2) * 2 + (m - 2) * (n - 2) / 2;
  printf("%ld\n", min);
}