D1, D2 = list(map(int, input().split())) if D1 > (D2**0.5)/2: print(8) elif D1 == (D2**0.5)/2: print(4) else: print(0)