// Problem: A - Star
// Contest: AtCoder - AtCoder Beginner Contest 192
// URL: https://atcoder.jp/contests/abc192/tasks/abc192_a
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

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

#define SPEED ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define endl '\n'
#define vi vector<int>
#define pii pair<int, int>
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define fill(a,b) memset(a, b, sizeof(a))
#define setbits(x) __builtin_popcountll(x)

const int inf=0x3f3f3f3f3f3f3f3f;
int dx[]={0,1,1,1,0,-1,-1,-1};
int dy[]={1,1,0,-1,-1,-1,0,1};

// <--------------------Code Begins Here-------------------->

int32_t main() {
    SPEED;
    int t = 1;
    // cin>>t;
    while(t--) {
    	int n;
    	cin>>n;
    	if(n % 100 == 0)cout<<100;
    	else {
    		int x = n - (100 * ((n + 99) / 100));
    		cout<<-x;
    	}
    }
    return 0;
}
#include<bits/stdc++.h>

using namespace std;
using ll = long long;
using llu = unsigned long long;
using ld = long double;

#define CEIL(x, y) (ll)ceil((ld)(x) / (ld)(y))

#define dbgLST(ds) for(auto it : ds) cout << it << ' ';
#define dbgMP(ds) for(auto it : ds) cout << it.first << ' ' << it.second << '\n';

const double PI = acos(-1.0), g = 9.80665;
const ll unseen = 0, pinf = 1e18 + 505, ninf = -1e18 - 505, md = 1000000007;
ll i, j, k, n, m;
bool is;  

void solve(void)
{
    ll n;
    cin >> n;

    ll lb = 1000;
    ll sz = 3;
    ll ans = 0;

    while(lb <= n) {
        ans += min((n - lb + 1), (lb * 9)) * (sz / 3);
        lb *= 10;
        sz++;
    }

    cout << ans;
}   

int main()
{
    ios_base::sync_with_stdio(false); 
    cin.tie(nullptr); 

    int testcase = 1;
    // cin >> testcase;
    while(testcase--) {
        solve();
    }    
    return 0;
}