d1, d2 = map(int,input().split()) d = -d2 + 2 * d1 if d > 0: print(8) elif d == 0: print(4) else: print(0)