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