d,e = map(int,input().split()) if d*d < e*e < d*d*2: print(2) elif d == e or d*d*2 == e*e: print(1) else: print(0)