#include <bits/stdc++.h>

using namespace std;
ifstream f1("CHARNUM.INP");
    ofstream f2("CHARNUM.OUT");

int main()
{ long long n,res=0,i;
f1>>n;
for (i=1;i<=n;i=i*10)
{ res=res+(n-i+1);
}
f2<<res;
}
