#include using namespace std; using ull = unsigned long long; int INF = 1000000000; int main(){ ull N; cin >> N; ull ans = 0; ull now = 0; ull check = 10; while(N >= check){ ans += now + 55; now += 100; check += 10; } for(ull j = check - 9;j <= N;j++)ans += j; cout << ans << endl; }