a,b =map(int,input().split()) s1 ={23,24,25} s2 ={i for i in range(a,b+1)} le =len(s1 & s2) print(3-le)