import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] arr = br.readLine().split(" ");
int n = Integer.parseInt(arr[0]);
int m = Integer.parseInt(arr[1]);
int countTwo = count(n, 2)-count(m, 2)-count(n-m, 2);
int countFive = count(n, 5)-count(m, 5)-count(n-m, 5);
System.out.println(Math.min(countTwo, countFive));
}
public static int count(int n, int k) {
if(n<k) { return 0; }
int count = 0;
int temp = n;
while(temp >= k) {
count += temp/k;
temp = temp/k;
}
return count;
}
}