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