https://www.acmicpc.net/problem/2004
n,m=map(int,input().split())
count2=0
count5=0
i=2
while i<=n:
count2+=n//i
i*=2
i=2
while i<=m:
count2-=m//i
i*=2
i=2
while i<=n-m:
count2-=(n-m)//i
i*=2
i=5
while i<=n:
count5+=n//i
i*=5
i=5
while i<=m:
count5-=m//i
i*=5
i=5
while i<=n-m:
count5-=(n-m)//i
i*=5
print(count2 if(count2<=count5) else count5)