Pagini recente » Cod sursa (job #2643832) | Cod sursa (job #940619) | Cod sursa (job #1495866) | Rating Ema Millers (estyera) | Cod sursa (job #2310255)
#include<bits/stdc++.h>
using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
typedef long long ll;
int main()
{
cin.tie(0);
ios_base::sync_with_stdio(0);
cout.tie(0);
ll n;in>>n;
ll i=5;
if(n==0)return out<<"1",0;
while(n>0){
ll x=i;
int sum=0;
while(x%5==0)++sum,x/=5;
n-=sum;
i+=5;
}
if(n==0)out<<i-5<<'\n';
else out<<"-1";
return 0;
}