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