#include<bits/stdc++.h>
#define ll          long long
#define ull         unsigned long long
#define inf         999999999999
#define F           first
#define S           second
#define eb          emplace_back
#define mpp         make_pair
#define P(x)        cout<<__LINE__ <<": "<<#x<<' '<<(x)<<'\n'
#define dbg         cout<<__LINE__ <<": 0manush\n"
#define read(x)     freopen("input.txt","r",stdin);
#define write(x)    freopen("aoutput.txt","w",stdout)
#define fast        ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pi          2*acos(0.0)
#define lcm(a,b)    ((a)*((b)/__gcd(a,b)))
#define mem(a,b)    memset(a,b,sizeof(a))
#define ee          exp(1)
#define mx          100000
#define mod         1000000007
using namespace std;
map<ll,ll>mp;
int main(){//read(x);//write(x);
//fast;
ll a,b,c,d,e,g,h,i,j,k,l,n,t;
cin>>n;
a=1;b=1;
for(i=1;i<=37;i++){
    a*=3;
    mp[a]=i;
}a=0;
for(i=1;i<26;i++){
    b*=5;
    c=n-b;
    if(mp[c]>0){
        a++;
        cout<<mp[c]<<' '<<i<<endl;
        break;
    }
}
if(a==0)cout<<-1<<endl;

}

#include<bits/stdc++.h>

using namespace std;
void solve();
int main()
{
	solve();
	return 0;
}
void solve()
{
	int x, total=100;
	cin>>x;
	if (x%total==0)
	{
		cout<<total;
	}
	else
	{
		int q = x%total;
		int res = total - q;
		cout<<res;
	}
}