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

long long n, m;
long long rez;

int main()
{
	scanf("%lld %lld", &n, &m);
	rez = m;
	for (int i = 0; i < n-2; ++i)
	{
		if (i % 2 == 0)
		{
			rez += m/2+1;
		}
		else if (i % 2 == 1)
		{
			rez += m-(m/2+1)+2;
		}
	}
	rez += m;
	printf("%lld\n", rez);

	return 0;
}