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 l = (int)Math.ceil(Math.sqrt(x * x + y * y) * 2); if (l % 2 == 0 && l * l / 2 / 2 == x * x + y * y) { l++; } System.out.println(l); sc.close(); } }