https://www.acmicpc.net/problem/2004
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
int n=s.nextInt();
int m=s.nextInt();
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;
System.out.format("%d",count2<=count5 ? count2 : count5);
}
}