#include <iostream>
using namespace std;
int main(void)
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int N, M, i = 0, j = 0;
int count = 0;
int temp = 0;
cin >> N >> M;
while (1)
{
if (N == 1)
{
break;
}
N = N - 1;
i++;
}
while (1)
{
if (M == 1)
{
break;
}
M = M - 1;
j++;
}
count = i + (i + 1) * j;
cout << count << "\n";
return 0;
}