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