n,m=map(int,input().split()) print(3-max(0,min(25,m)-max(23,n)+1))