l,r=map(int,input().split()) c=[False,False,False] for i in range(l,r+1): if i<=295: c[0]=True elif i<=416: c[1]=True else: c[2]=True print(sum(c)-1)