import math x, y = map(int, raw_input().split()) print int(math.sqrt(x*x+y*y)*2)