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 s = xp * xp + yp * yp; int r = (int)Math.sqrt(s); int ans = 0; for(int i = 2 * r; i <= 2 * r + 4; i++) { if(i * i > 4 * s) { ans = i; break; } } System.out.println(ans); } }