import subprocess

A,B = list(map(int, subprocess.check_output("dd").split()))

print((A-1)*(B-1))

import sys

A,B = list(map(int, sys.stdin.read().split()))

print((A-1)*(B-1))
import subprocess

A, B = list(map(int, subprocess.check_output("dd").split()))
print((A - 1) * (B - 1))

import sys

A, B = list(map(int, sys.stdin.read().split()))
print((A - 1) * (B - 1))

-import subprocess +import sys -A, B = list(map(int, subprocess.check_output("dd").split())) +A, B = list(map(int, sys.stdin.read().split()))