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

#include <stdio.h>
#include <math.h>

long long a[118] = {
	1, 2, 4, 6, 12, 24, 36, 48, 60, 120,
	180, 240, 360, 720, 840, 1260, 1680, 2520, 5040, 7560,
	10080, 15120, 20160, 25200, 27720, 45360, 50400, 55440, 83160, 110880,
	166320, 221760, 277200, 332640, 498960, 554400, 665280, 720720, 1081080, 1441440,
	2162160, 2882880, 3603600, 4324320, 6486480, 
	7207200, 8648640, 10810800, 14414400, 17297280,
	21621600, 32432400, 36756720, 43243200, 61261200,
	73513440, 110270160, 122522400, 147026880, 183783600,
	245044800ULL, 294053760ULL, 367567200ULL, 551350800ULL, 698377680ULL,
	735134400ULL, 1102701600ULL, 1396755360ULL, 2095133040ULL, 2205403200ULL,
	2327925600ULL, 2793510720ULL, 3491888400ULL, 4655851200ULL, 5587021440ULL,
	6983776800ULL, 10475665200ULL, 13967553600ULL, 20951330400ULL, 27935107200ULL,
	41902660800ULL, 48886437600ULL, 64250746560ULL, 73329656400ULL, 80313433200ULL,
	97772875200ULL, 128501493120ULL,146659312800ULL,160626866400ULL,240940299600ULL,
	293318625600ULL,321253732800ULL,481880599200ULL,642507465600ULL,963761198400ULL,
	1124388064800ULL,1606268664000ULL,1686582097200ULL,1927522396800ULL,2248776129600ULL,
	3212537328000ULL,3373164194400ULL,4497552259200ULL,6746328388800ULL,8995104518400ULL,
	9316358251200ULL,13492656777600ULL,18632716502400ULL,26985313555200ULL,27949074753600ULL,
	32607253879200ULL,46581791256000ULL,48910880818800ULL,55898149507200ULL,65214507758400ULL,
	93163582512000ULL,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)
{
	int i, d, p, sw;
	long long ans;
	int *pp;

	 ans = 1;
	 if ((n & 1) == 0) {
	    p = 2;  
		do n >>= 1, p <<= 1;
	    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);
	}
	if (n > 1) {
		int b = (int)sqrt((double)n);
		for (i = 1009, sw = 0; n > 1; ) {
			if (i > b) { ans *= (n+1); break; }
			if (n % i == 0) {
				p = i;  
				do n /= i, p *= i;
				while (n % i == 0);
				ans *= (p-1)/(i-1);
			}
			if (sw) i += 2, sw = 0;
			else    i += 4, sw = 1;
		}
	}
	return ans;
}

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

    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;
}