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