https://www.acmicpc.net/problem/2004
using System;
class Program
{
static void Main() {
string[] s=Console.ReadLine().Split(' ');
long n=int.Parse(s[0]);
long m=int.Parse(s[1]);
long count2=0;
long count5=0;
for(long i=2;i<=n;i*=2) count2+=n/i;
for(long i=2;i<=m;i*=2) count2-=m/i;
for(long i=2;i<=n-m;i*=2) count2-=(n-m)/i;
for(long i=5;i<=n;i*=5) count5+=n/i;
for(long i=5;i<=m;i*=5) count5-=m/i;
for(long i=5;i<=n-m;i*=5) count5-=(n-m)/i;
Console.Write("{0}",count2<=count5 ? count2 : count5);
}
}