import math D = list(map(int, input().split())) are = math.sqrt(D[1]) / math.sqrt(2) if D[0] < D[1] and D[0] > are: print(8) elif D[0] == D[1] or D[0] == are: print(4) else: print(0)