s=1000
x=1
while s>0:
if s%5==1:
x=int(s/5)*4
for i in range(1,6):
if x%5==1:
x=int(x/5)*4
else:
break
if i==5:
print(s)
print(int(s/5)-int(x/4))
break
s-=1
s=1000
x=1
while s>0:
if s%5==1:
x=int(s/5)*4
for i in range(1,6):
if x%5==1:
x=int(x/5)*4
else:
break
if i==5:
print(s)
print(int(s/5)-int(x/4))
break
s-=1