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