#!/bin/python3 import sys n,m = input().strip().split(' ') n,m = [int(n),int(m)] if n*m>3: print(n*m) else: print(n*m-1)