#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    cin >> n;
    
    int sln = 0;

    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= n; j++)
        {

            if (i*j > n)
            {
                break;
            }
            


            for (int k = 1; k <=n; k++)
            {

                if (i*j*k <= n)
                {
                    sln++;
                }
                else
                {
                    break;
                }
                
            }
        }
    }

    cout << sln;
    
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
template<class T>bool umax(T &a, const T &b) {if(a<b){a=b;return 1;}return 0;}
template<class T>bool umin(T &a, const T &b) {if(b<a){a=b;return 1;}return 0;}
#ifdef _GLIBCXX_DEBUG
void _debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void _debug_out(Head H, Tail... T) { cerr << " " << H; _debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", _debug_out(__VA_ARGS__)
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define debug(...)
#define eprintf(...)
#endif

ll solve(ll n) {
  if(n < 1000) {
    return 0;
  }

  ll c = 0;
  ll r = 1000;
  ll ans = 0;

  while(n >= r-1) {
    ans += (r-1  - (r/1000) + 1) * c;
    debug(ans,r,c);
    c++;
    r *= 1000;
  }
  debug("========");
  debug(n,r,c,ans);
  ans += (n  - (r/1000-1)) * c;
  return ans;
}

int main() {
  ll n; cin >> n;
  cout << solve(n) << endl;
}
