#include<iostream>
#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define l long
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define vi vector<int>
#define vll vector<ll>
#define pb push_back
#define ld long double
#define mp make_pair
#define pii pair<int,int>
#define mod 1000000007
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
int main()
{
 ios_base::sync_with_stdio(false);
 cin.tie(NULL);  
 ll n;
  cin>>n;
  ll a=1000;
  ll ans=0;
  while(a<=n)
  {
    ans+=n-a+1;
    a*=1000;
  }
  cout<<ans<<endl;
}  
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <iterator>
#include <map>
#include <unordered_map>
#include <numeric>
#include <set>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <tuple>
#include <cstdio>

#include <chrono> //performance check

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<set<int>> graph;
typedef pair<int, int> pii;
typedef vector<pair<int, int>> vpii;

template <typename T>
istream &operator>>(istream &is, vector<T> &arr);
template <typename T>
ostream &operator<<(ostream &os, vector<T> &arr);
template <typename T, typename U>
ostream &operator<<(ostream &os, pair<T, U> &p);

#define setup() (ios_base::sync_with_stdio(false), cin.tie(0))
#define forN(i, n) for (int i = 0; i < int(n); i++)
#define forRange(i, l, r) for (int i = int(l); i <= int(r); i++)

template <typename T>
istream &operator>>(istream &is, vector<T> &arr)
{
	typename vector<T>::iterator a;
	for (a = arr.begin(); a != arr.end(); a++)
	{
		is >> *a;
	}
	return is;
}

template <typename T>
ostream &operator<<(ostream &os, vector<T> &arr)
{
	typename vector<T>::iterator a;
	for (a = arr.begin(); a != arr.end(); a++)
	{
		os << *a << " ";
	}
	os << endl;
	return os;
}

template <typename T, typename U>
ostream &operator<<(ostream &os, pair<T, U> &p)
{
	os << p.first << " " << p.second << '\n';
	return os;
}

ll INF = 1e18;
ll MOD = 998244353;

ll mul(ll a, ll b)
{
	return (a % MOD * b % MOD) % MOD;
}

ll add(ll a, ll b) { return (a % MOD + b % MOD) % MOD; }

bool valid(int i, int j, int n, int m)
{
	return i >= 0 && i < n && j >= 0 && j < m;
}

vector<pair<int, int>> dirs = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};

int main()
{
	// freopen("output.txt", "w", stdout);

	int n;
	cin >> n;
	cout << (n % 2 == 1 ? "Black" : "White") << endl;
}
