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