#!/bin/python import sys n,m = raw_input().strip().split(' ') n,m = [int(n),int(m)] if m==1: print n-1 elif n==1: print m-1 elif m!=1 and n!=1: print m*n-1