from math import ceil Xp, Yp = [int(i) for i in input().strip().split(' ')] ans = ((Xp ** 2) + (Yp ** 2)) ** (1 / 2) * 2 print([ceil(ans), ceil(ans) + 1][ceil(ans) == ans])