#include <bits/stdc++.h>
using namespace std;
int A, B, T;
int main() {
  int MEMO[6][45] = {{0,  1,  2,  2,  3,  4,  4,  5,  6,  6,  7,  8,  8,  9,
                      10, 10, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18,
                      19, 20, 20, 21, 22, 22, 23, 24, 24, 25, 26, 26},
                     {0,  2,  4,  5,  7,  8,  10, 11, 13, 14,
                      16, 17, 19, 20, 22, 23, 25, 26, 28, 29},
                     {0, 0, 6, 8, 11, 13, 15, 17, 20, 22, 24, 26, 29},
                     {0, 0, 0, 12, 14, 17, 21, 24, 26, 30},
                     {0, 0, 0, 0, 18, 22, 26, 29},
                     {0, 0, 0, 0, 0, 26}};
  scanf("%d%d", &A, &B);
  if (A > B) {
    T = A;
    A = B;
    B = T;
  }
  printf("%d\n", MEMO[A - 1][B - 1]);
}
