#!/bin/python import sys n,m = raw_input().strip().split(' ') n,m = [int(n),int(m)] total_pieces = n*m print total_pieces-1