import java.util.*; public class Main { 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 r = (int)Math.sqrt(d); double z = r; while(true){ if(z*z<=d){ z=z+0.5; }else{ break; } } int a = (int)(2*z); System.out.println(a); } }