#include <bits/stdc++.h>
using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, m;
    cin >> n >> m;
    int redari = 0;
    int br2 = m - 2;
    int br1 = n - 2; 
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            if (i == 0 || i == n - 1 || j == 0 || j == m - 1) {
                redari += 1;
            }
            while(br1 != 0){
                if(br1 % 2 != 0){
                    redari += br2 / 2;
                }
                else if(br1 % 2 == 0 && br2 % 2 == 0){
                    redari += br2/2;
                }
                else{
                    redari += (br2/2)+1;
                }
                br1--; 
            }
        }   
    }
    
    cout << redari << endl;
    return 0;
}