#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std; using ll = long long;
using ull = unsigned long long; using P = pair<int, int>;
const int INF = 1e9; const int MOD = 1000000007;
const int dx[] = {-1,0,1,0}; const int dy[] = {0,-1,0,1};
//const int dx[] = {-1,-1,-1, 0, 0, 1, 1, 1}; const int dy[] = {-1, 0, 1,-1, 1,-1, 0, 1};
#define PI 3.14159265358979323846264338327950L 
//cout << fixed << setprecision(10) << Min << endl << Max << endl;

int main() {
	ll N; cin >> N;
	if (N < 8) {
		cout << "-1" << endl; return 0;
	}
	ll ans5 = 0, ans3 = 0;
	ll tmp = 1;
	while (1) {
		tmp = tmp * 5;
		ll tmp2 = N - tmp;
		if (tmp2 < 3) {
			cout << "-1" << endl; return 0;
		}
		ans5++;
		
		ans3 = 0;
		while (tmp2 % 3 == 0) {
			tmp2 /= 3;
			ans3++;
		}
		if (tmp2 > 1) continue;
		else break;
	}
	cout << ans3 << " " << ans5 << endl;
}
#include <bits/stdc++.h>

using namespace std;

int main()
{
    // int t {0};
    // cin >> t;
    // while (t--)
    // {
        int l {0};
        cin >> l;
        // long long int ans = C((long long int) l - 1, (long long int) 11);
        // cout << ans << endl;
        vector < vector <long long int> > C (l, vector <long long int> (12));
        C[0][0] = 1;
        for (int i = 1; i < 12; i++)
        {
            C[1][i] = 0;
        }
        for (int i = 1; i < l; i++)
        {
            C[i][0] = 1;
            for (int j = 1; j < 12; j++)
            {
                C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
            }
        }
        long long int ans = C[l - 1][11];
        cout << ans << endl;
    // }
    return 0;
}