import java.util.*; public class Test39{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int Xp = sc.nextInt(); int Yp = sc.nextInt(); int D = (Xp*Xp)+(Yp*Yp); int i = 1; if(Xp == Yp){ if(Xp != 0){ while(D>i*i){ i++; } System.out.println(2*i); }else{ System.out.println("1"); } }else{ while(D>i*i){ i++; } System.out.println((2*i)+1); } } }