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