#39862: python ans


mu0975353917@gmail.com (Moon Chan)


t,r=map(int,input().split())
temp=0
for i in range(t,r+1):
    if i%4==0 and i%100!=0 or i%400==0:
        temp+=1
print(temp)