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