#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main()
{
    double n;
    cin >> n;
    double ans = 0;
    for (int i = 1; i <= n - 1; i++)
    {
        ans += (n / (n - i));
    }
    cout << std::fixed << std::setprecision(15) << ans << endl;
}

using namespace std;
#include<string>
#include<cmath>
#include<list>
#include <map>
#include <unordered_map>
#include <set>
#define ll long long
#define ld long double
#define ull unsigned long long
#define ml map<ll,ll>
#define pb push_back
#define mp make_pair
#define ppl pair<ll,ll>
#define F first
#define S second
#define fio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)

#define fr(i,a,b) for(ll i=a;i<b;i++)
#define ffr(i,a,b) for(ll i=a;i>=b;i--)
#include<bits/stdc++.h>
#include<vector>
#define vl vector<ll>
#define PI 3.141592654
const ll N = 1e9 + 7;
#include<iterator>
#define EPSILON numeric_limits<double>::epsilon()




// vector<vl> v;
// vector<bool> visited;

// void dfs(ll pnt, ll &edge, ll &pt) {
// 	visited[pnt] = 1;
// 	pt++;
// 	fr(i, 0, v[pnt].size()) {
// 		edge++;
// 		if (!visited[pnt])dfs(v[pnt][i], edge, pt);
// 	}
// }



int gcd(int a, int b) {
	if (a == b)return a;
	if (a % b == 0)return b;
	if (b % a == 0)return a;
	if (b > a)return gcd(a, b % a);
	if (a > b)return gcd(a % b, b);
	return 0;
}





void solve() {
	ll n; cin >> n;
	ll b = log2(n) / log2(5);
	b++;
	fr(i, 1, b) {
		ll f = 1, q = 1;
		fr(j, 0, i)f *= 5;
		if (f < n) {
			f = n - f;
			ll g = log2(f) / log2(3);
			fr(l, 0, g)q *= 3;
			if (q == f && g > 0) {cout << g << " " << i; return;}
		}
	}
	cout << -1;
}






int main() {
	fio;
#ifndef ONLINE_JUDGE
	// for getting input
	freopen("input.txt", "r", stdin);//298023223876953125
	//for writing output
	freopen("jout.txt", "w", stdout);
#endif
	//prime();
	ll t;
	if (1)
		t = 1;
	else
		cin >> t;
	while (t--) {
		//cout << "Case #" << h << ": ";
		solve();
		//h++;
		cout << '\n';
	}
	return 0;
}