f=lambda n:0 if n<296 else 1 if n<417 else 2 L,R=map(int,input().split()) R=f(R)-f(L) print(R)