import java.util.Scanner; public class Main_yukicoder98 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); int r = (int)Math.ceil(Math.sqrt(x * x + y * y)); int ret = 2 * r; if (r * r == x * x + y * y) { ret++; } System.out.println(ret); sc.close(); } }