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