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