#include <cstdio>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

const double EPS = 1.0e-10;

void primeNumber(int N, vector<bool>& prime)
{
    prime.assign(N+1, true);
    prime [0] = prime[1] = false;
    for(int i=2; i*i<=N; i++){
        if(prime[i]){
            for(int j=i; i*j<=N; j++){
                prime[i*j] = false;
            }
        }
    }
}

int MAX = 500;
vector<int> prime;
map<long long, double> m;

void solve(int i, long long a, long long sum)
{
    if(a > 1000000000000000LL)
        return;

    m[a] = sum / (double) a;
    map<long long, double>::iterator it = m.find(a);
    while(it != --m.end()){
        map<long long, double>::iterator it2 = it;
        ++ it2;
        if(it2->second < it->second){
            m.erase(it2);
        }else{
            break;
        }
    }
    if(it != m.begin()){
        map<long long, double>::iterator it2 = it;
        -- it2;
        if(it2->second > it->second)
            m.erase(it);
    }

    if(i > prime.size())
        return;

    long long tmp = 1;
    long long sum2 = sum;
    for(;;){
        a *= prime[i];
        if(a > 1000000000000000LL)
            return;

        tmp *= prime[i];
        sum2 += sum * tmp;

        solve(i+1, a, sum2);
    }
}

int main()
{
    vector<bool> isPrime;
    primeNumber(MAX, isPrime);
    for(int i=0; i<=MAX; ++i){
        if(isPrime[i])
            prime.push_back(i);
    }

    solve(0, 1, 1);
    m[LLONG_MAX] = 0.0;

    for(;;){
        long long k;
        cin >> k;
        if(k == 0)
            return 0;

        map<long long, double>::iterator it = m.upper_bound(k);
        -- it;
        printf("%.10f\n", it->second);
    }
}