#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <stdio.h>
#include <math.h>
#include <iomanip>
#include <queue>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double lld;

#define rep(i,n) for(int i = 0; i < (n); i++)
#define pb push_back 
#define eb emplace_back 
#define fi first
#define se second
#define all(x) x.begin() , x.end()
#define vi vector<int>
#define vP vector<pair<int,int>>
#define vll vector<ll>

const static int INF = 1001001001;
const static ll LINF = 1001001001001001001LL;
const static lld PI = 3.1415926535897932384626L;
const static int MOD = 1000000009;
//const static int MOD = 998244353;

template < typename T > T gcd (T a , T b) { if (a < b) swap(a , b); if (a % b == 0) return b; else return gcd (b , a % b); }
template < typename T > T lcm (T a , T b) { return (a / gcd (a , b) * b); }
template < typename T > void chmin (T &a , T b) { if (a > b) a = b; }
template < typename T > void chmax (T &a , T b) { if (a < b) a = b; }

void io_setup () {
    cout << fixed << setprecision(30);
    cin.tie(0);
    ios::sync_with_stdio(false);
}

//memo
////v.erase(unique(v.begin(), v.end()), v.end());

int main () {
    io_setup();
    lld n;
    cin >> n;
    lld ans = 0.0;
    for (int i = 1; i <= n - 1; i++) {
        ans += n / (lld)i;
    }
    cout << ans << endl;
    return 0;
}


#include <cmath>
#include<bits/stdc++.h>

using namespace std;
#define int long long
#define rep(i,a,b) for(int i=a; i<b; ++i)
#define all(x) x.begin(),x.end()

const long long INF=1e18;
const int32_t M=1e9+7;
const int32_t MM=998244353;

int digits (int a1)
{
    int a=a1;
    int x = 0;
    while(a!=0){
        a/=10;
        x++;
    }
    return x;
}

void solve()
{
  int n; cin >> n;
  int d = digits(n);
  int nr = n;
  vector<int> di;
  rep(i,0,d){
    di.push_back(nr%10);
    nr/=10;
  }
  reverse(all(di));
  int ans = 0;
  int y=1;
  for(int i=2; i<d; i+=2){
     int b = (i/2);
     if(i!=2) y*=10;
     ans += 9*y;
  }
  if(d%2==1){
    cout << ans << endl;
    return;
  }
  int l=0,r=0;
  int p = (d/2)-1;
  for(int i=0;i<d/2;i++){
    l += di[i]*pow(10,p-i);
    r += di[(d/2)+i]*pow(10,p-i);
  }
  int k = l-pow(10,p);
  k++;
  ans += k;
  if(l<=r) cout << ans << endl;
  else cout << ans-1 << endl;

}

int32_t main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int t=1;//cin>>t;
    while(t--) solve();
    return 0;
}

