D = list(map(int, input().split())) are = D[1] / 2 if D[0] < D[1] and D[0] > are: print(8) elif D[0] == D[1] or D[0] == are: print(4) else: print(0)