#!/usr/bin/env python3
# https://abc069.contest.atcoder.jp/tasks/abc069_a
n, m = map(int, input().split())
print((n - 1) * (m - 1))

#!/usr/bin/env python3
# https://abc069.contest.atcoder.jp/tasks/abc069_a
n, m = map(int, input().split())
print((n - 1) * (m - 1))

#!/usr/bin/env python3 # https://abc069.contest.atcoder.jp/tasks/abc069_a