using namespace std; int n; long long c(int x) { long long sum = x; int now = 5; while(x/now != 0) { sum += x/now; now *= 5; } return sum; } int main() { scanf("%d", &n); int l = 1, r = n; long long ans = 0; while(l < r) { int m = (l+ r)/2; // printf("l:%d r:%d m:%d\n",l,r,m); if(c(m) < n) l = m + 1; else if(c(m) > n) r = m; else { ans = m; break; } } if(ans != 0) { printf("%lld", ans * 5); return 0; } if(c(l) == n) ans = l; else { ans = r; } printf("%lld", ans * 5); return 0; }