import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextInt(); long m = sc.nextInt(); if(n>m) System.out.print(n-1+((m-1)*n)); else System.out.print(m-1+((n-1)*m)); } }