import math d1,d2=map(int,input().split()) if d1**2 * 2 == d2 ** 2: print(4) elif d1**2 * 2 < d2 ** 2: print(8) else: print(0)