day=[31,28,31,30,31,30,31,31,30,31,30,31]
a,b=map(int,input().split())
c,d=map(int,input().split())
x=[]
for i in range(a+1,c):
x.append(i)
sum=0
if x!=[]:
for j in range(len(x)):
sum+=day[x[j]-1]
if a!=c:
sum+=(day[a-1]-b+1)
sum+=d
else:
sum+=(d-b+1)
y=sum//10
sum-=y
print(sum*100)