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