https://www.acmicpc.net/problem/2004
#include<stdio.h>
#include <string.h>
int main() {
int n,m;
scanf("%d %d",&n,&m);
int count2=0;
int 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;
printf("%d", count2<=count5 ? count2 : count5);
}