import java.util.Scanner; class Question098 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int x = scan.nextInt(); int y = scan.nextInt(); double r = Math.floor(Math.sqrt(Math.pow(x,2)+Math.pow(y,2))); System.out.println((int)(2*r+1)); } }