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