L,R = map(int,input().split()) ans = 0 for i in range(L,R+1): if i == 245 or i == 416: ans += 1 print(ans)