# coding: utf-8 d1, d2 = map(int,input().split()) r = d1**0.5 d = (d2/2)**0.5 d_ = d2**0.5 if r < d: ans = 0 elif r == d: ans = 4 elif d < r < d_: ans = 8 elif r == d_: ans = 4 else: ans = 0 print(ans)