R,C = map(int,raw_input().split())
c = -1
table = [[0 for j in range(C)]for i in range(R)]
for i in range(R):
	for j in range(C):
		if table[i][j] == 1:continue
		table[i][j] = 1
		table[R - 1 - i][C - 1 - j] = 1
		c += 1
print c