#include <stdio.h>
long long count(long long n,int k) {
long long cnt=0;
while(n>=k) {
cnt+=n/k;
//k*=k;
n/=k;
}
return cnt;
}
long long min(long long a,long long b){
return a<b ? a:b;
}
int main() {
int n,m;
int cntn,cntm;
scanf("%d %d",&n, &m);
long long five =count(n,5)-count(m,5)-count(n-m,5);
long long two =count(n,2)-count(m,2)-count(n-m,2);
printf("%lld",min(two,five));
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: