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