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