import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); long i,m,n; n=in.nextLong(); m=in.nextLong(); if(m==1)System.out.println(n-1); else if(n==1)System.out.println(m-1); else { System.out.println(n*m-1); } } }