// Aizu 2123: Divisor Function
// 2017.9.20 bal4u@uu

#include <stdio.h>

long long a[82] = {
1ULL, 2ULL, 4ULL, 6ULL, 12ULL, 24ULL, 36ULL, 48ULL, 60ULL, 120ULL,
180ULL, 240ULL, 360ULL, 720ULL, 840ULL, 1260ULL, 1680ULL, 2520ULL, 5040ULL, 10080ULL,
15120ULL, 25200ULL, 27720ULL, 50400ULL, 55440ULL, 110880ULL, 166320ULL, 277200ULL, 332640ULL, 554400ULL,
665280ULL, 720720ULL, 1441440ULL, 2162160ULL, 3603600ULL,
4324320ULL, 7207200ULL, 8648640ULL, 10810800ULL, 21621600ULL,
36756720ULL, 61261200ULL, 73513440ULL, 122522400ULL, 147026880ULL,
183783600ULL, 367567200ULL, 698377680ULL, 735134400ULL, 1102701600ULL,
1396755360ULL, 2205403200ULL, 2327925600ULL, 2793510720ULL, 3491888400ULL,
6983776800ULL, 13967553600ULL, 20951330400ULL, 27935107200ULL, 41902660800ULL,
48886437600ULL, 80313433200ULL, 146659312800ULL, 160626866400ULL, 321253732800ULL,
481880599200ULL, 642507465600ULL, 963761198400ULL, 1124388064800ULL, 1927522396800ULL,
2248776129600ULL, 3373164194400ULL, 4497552259200ULL, 6746328388800ULL, 9316358251200ULL,
18632716502400ULL, 27949074753600ULL, 32607253879200ULL, 55898149507200ULL, 65214507758400ULL,
97821761637600ULL, 130429015516800ULL };

int ptbl[] = {
         3,   5,   7,  11,  13,  17,  19,  23,  29,
   31,  37,  41,  43,  47,  53,  59,  61,  67,  71,
   73,  79,  83,  89,  97, 101, 103, 107, 109, 113,
  127, 131, 137, 139, 149, 151, 157, 163, 167, 173,
  179, 181, 191, 193, 197, 199, 211, 223, 227, 229,
  233, 239, 241, 251, 257, 263, 269, 271, 277, 281,
  283, 293, 307, 311, 313, 317, 331, 337, 347, 349,
  353, 359, 367, 373, 379, 383, 389, 397, 401, 409,
  419, 421, 431, 433, 439, 443, 449, 457, 461, 463,
  467, 479, 487, 491, 499, 503, 509, 521, 523, 541,
  547, 557, 563, 569, 571, 577, 587, 593, 599, 601,
  607, 613, 617, 619, 631, 641, 643, 647, 653, 659,
  661, 673, 677, 683, 691, 701, 709, 719, 727, 733,
  739, 743, 751, 757, 761, 769, 773, 787, 797, 809,
  811, 821, 823, 827, 829, 839, 853, 857, 859, 863,
  877, 881, 883, 887, 907, 911, 919, 929, 937, 941,
  947, 953, 967, 971, 977, 983, 991, 997, 0 };

long long sum_of_divisor(long long n)
{
	long long ans, p, d;
	int *pp;

	 ans = 1;
	 if ((n & 1) == 0) {
	    p = 2;  
		do n >>= 1, p <<= 1ULL;
	    while ((n & 1) == 0);
		ans *= p-1;
	}
	if (n <= 1) return ans;
	for (pp = ptbl; *pp > 0; pp++) {
		if (n % *pp) continue;
		p = d = *pp;  
		do n /= d, p *= d;
		while (n % d == 0);
		ans *= (p-1) / (d-1);
	}
	return ans;
}

int bsch(long long x)
{
	int m, l = 0, r = 82;

    while (l < r) {
        m = (l + r) >> 1;
        if (a[m] <= x) l = m + 1; else r = m;
    }
	return l-1;
}


int main()
{
	int k;
	long long n;

	while (scanf("%lld", &n) && n) {
		k = bsch(n);
		printf("%.6lf\n", (double)sum_of_divisor(a[k])/(double)a[k]);
	}
	return 0;
}