a,b=map(int,input().split()) print(8 if b/2<=a<=b else 0)