mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline a, b = map(int, input().split()) mod = 1000000007 eps = 10 ** -9 def main(): import sys input = sys.stdin.readline b, a = map(int, input().split()) if a == b: print(4) elif b < a: print(0) elif a == 2 * b: print(4) elif a > 2 * b: print(0) else: print(8) if __name__ == '__main__': main() if __name__ == '__main__': main()