import java.util.Scanner; public class Yukicoder98 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double x = sc.nextDouble(), y = sc.nextDouble(); if (Math.hypot(x, y) % 1 == 0) System.out.println(1 + 2 * (int) Math.ceil(Math.hypot(x, y))); else System.out.println(2 * (int) Math.ceil(Math.hypot(x, y))); } }