#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int count_factors_of_5(int n) {
int count = 0;
while (n > 0) {
n /= 5;
count += n;
}
return count;
}
int find_smallest_N_with_exactly_P_zeros(int p) {
int low = 0, high = p * 5;
while (low < high) {
int mid = (low + high) / 2;
if (count_factors_of_5(mid) < p) {
low = mid + 1;
} else {
high = mid;
}
}
return low;
}
int main() {
int p;
fin >> p;
if (p == 0) {
fout << 1;
} else {
fout << find_smallest_N_with_exactly_P_zeros(p);
}
return 0;
}