Vanya got an important task — he should enumerate books in the library and label each book with its number. Each of the *n* books should be assigned with a number from 1 to *n*. Naturally, distinct books should be assigned distinct numbers.

Vanya wants to know how many digits he will have to write down as he labels the books.
The first line contains integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">9</sup>) — the number of books in the library.
#include <bits/stdc++.h>
using namespace std;
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define rep1(i,a,b) for (int i = a;i <= b;i++)
#define rep2(i,a,b) for (int i = a;i >= b;i--)
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define rei(x) scanf("%d",&x)
#define rel(x) scanf("%I64d",&x)

typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

//const int MAXN = x;
const int dx[9] = {0,1,-1,0,0,-1,-1,1,1};
const int dy[9] = {0,0,0,-1,1,-1,1,-1,1};
const double pi = acos(-1.0);

int n;
LL ans = 0;
string now;

LL cl(string x)
{
    int len = x.size();
    LL now = 0;
    rep1(i,0,len-1)
        now = now*10+x[i]-'0';
    return now;
}

int main()
{
    //freopen("F:\\rush.txt","r",stdin);
    rei(n);
    now = "0";
    int len = 1;
    LL pre = 0;
    while (1)
    {
        LL key = cl(now+"9");
        if (key <= n)
        {
            ans+=(key-pre)*len;
            len++;
            now+="9";
        }
        else
            break;
        pre = key;
    }
    if (pre==n)
        cout << ans <<endl;
    else
    {
       // cout << ans <<endl;
       // cout << len<<endl;
       // cout << pre<<endl;
        ans+=len*(n-pre);
        cout << ans<<endl;
    }
    return 0;
}
			  	 		  		 				 	    		   		