#include <bits/stdc++.h>
#define int long double
using namespace std;

int n;
int ans;

signed main(){
    cin>>n;

    for(int i=2;i<=n;i++){
        ans+=n*1.0/(n-i+1);
    }

    cout<<fixed<<setprecision(10)<<ans<<endl;

    return 0;
}
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <unordered_map>
#include <unordered_set>

#include <bits/stdc++.h>
using namespace std;
using rr = long long;
using O = pair<int, int>;
#define rep(dsfgt, polkmnjh) for (int dsfgt = 0; dsfgt < (polkmnjh); dsfgt++)
int main()
{
    rr polkmnjh, satybnh = 0, dfgv = 1;
    cin >> polkmnjh;
    while (1)
    {
        string hikaku = to_string(dfgv) + to_string(dfgv);
        if (stoll(hikaku) <= polkmnjh)
        {
            satybnh++;
            dfgv++;
        }
        else
        {
            break;
        }
    }
    cout << satybnh << endl;
    return 0;
}