import java.util.Scanner;

public class Main1 {
    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
        int N = s.nextInt(),M = s.nextInt();

        int suma = 0;
        if(N == 1 && M == 1)
            suma = 1;
        else if( N == 1 || M == 1){
            if(N != 1) suma = N;
            if(M != 1) suma = M;
        } else
        {
            suma = 2 * N + 2 * M - 4 + (((M -2) * (N -2)) / 2);
        }



        System.out.println(suma);
    }
}