n=int(input())
if n%2!=0:
    print(0)
    exit()
n//=2
res=0
while n:
    res+=n//5
    n//=5
print(res)

n=int(input())
if n%2!=0:
    print(0)
    exit()
n//=2
res=0
while n:
    res+=n//5
    n//=5
print(res)
