a,b=list(map(int,input().split())) c=0 for i in range(a+1,b-1): if i%400==0 or i%100!=0 and i%4==0: c+=i else: c+=0 print(c)