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) { double r = Math.ceil(Math.sqrt(x*x+y*y)); if(x*x+y*y == (int)(r*r)) r = 2*r+1; else r = 2*r; System.out.println((int)r); } }