import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(), y = sc.nextInt(); sc.close(); System.out.print((int)(Math.hypot(x, y) * 2 + 1)); } }