#!/bin/python3
import sys


m, n = [int(i) for i in input().strip().split()]

print(m - 1 + m * (n - 1))