http://acm.hdu.edu.cn/showproblem.php?pid=1418
/*
2011-9-15
author:BearFly1990
*/
package acm.hdu.tests;
import java.io.BufferedInputStream;
import java.util.Scanner;
public class HDU_1418 {
public static void main(String[] args) {
Scanner in = new Scanner(new BufferedInputStream(System.in));
while(in.hasNext()){
long n = in.nextLong();
long m = in.nextLong();
if(n == 0 && m == 0)break;
System.out.println(m+n-2);
}
}
}