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