import java.util.Scanner; public class Main { public static void main(String[] a) { Scanner s=new Scanner(System.in); int x=s.nextInt(),y=s.nextInt(); System.out.println(1+(int)(2*Math.sqrt(x*x+y*y))); } }