#include <bits/stdc++.h>
using namespace std;
int nrZerouri(int nr) {
int ans = 0;
for (int put = 5; put <= nr; put *= 5) {
ans += nr / put;
}
return ans;
}
int main() {
#ifndef LOCAL
freopen("fact.in", "r", stdin);
freopen("fact.out", "w", stdout);
cin.tie(nullptr)->sync_with_stdio(false);
#endif
int p; cin >> p;
int ans = -1, st = 1, dr = 1e8;
while (st <= dr) {
int mid = st + (dr - st) / 2;
int q = nrZerouri(mid);
if (q >= p) {
if (q == p) {
ans = mid;
}
dr = mid - 1;
} else {
st = mid + 1;
}
}
cout << ans << '\n';
return 0;
}