n, m = sorted(map(int, raw_input().split())) print n - 1 + n * (m - 1)