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

int main(){
      int n, m;
            scanf("%d %d", &n, &m);

                  if(m == 1)
                              printf("%d\n", n);
                                    
                                          else{
                                                      long long br = 0;

                                                                  br += 2 * n;
                                                                              m -= 2;
                                                                                          n -= 2;

                                                                                                      br += (m / 2 + m%2) * (2 + n / 2);
                                                                                                                  br += (m / 2) * (2 + n / 2 + 1);

                                                                                                                              printf("%lld\n", br);
                                                                                                                                    }
                                                                                                                                          return 0;
                                                                                                                                          }