stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <bits/stdc++.h>

using namespace std;



#define pb push_back

#define F first

#define S second

#define fo(i,a,b)  for(int i = a; i < b; i++)



using ll = long long;

using ld = long double;

using ul = unsigned long long;

using ii = pair<int, int>;

#define Mosta     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define ReadFile            freopen("input.in","r",stdin)

#define WriteFile           freopen("output.txt","w",stdout)

const ll mod7 = 1000000007,mod = 1000000000,OO = 0x3f3f3f3f;

const ld EPS = 1e-7;

double Pi=acos(-1);

const ld rad=Pi/180.0;

ll power(ll x, ll y, ll p)

{

    ll res = 1;

    while (y > 0)

    {

        if (y & 1)

            res = (res*x) % p;

        y = y>>1;

        x = (x*x) % p;

    }

    return res;

}

ll nCr (ll n,ll m)

{

    return(m == 0)?1:n*nCr(n-1,m-1)/m;

}

/*****************************************************/



bool _check(ll i){

    string s = to_string(i);

    ll m = s.length();

    if(m % 2 == 1)

        return true;

    else

        return false;

}



int main()

{

    ll n , x = 0;



    cin >> n;



    for(ll i = 1; i <= n; ++i)

        if(_check(i))

            x++;



    cout << x << "\n";



	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.40757062286393x):
#include<stdio.h>



int main()

{

    int n,i,digit=0,mod,num;



    scanf("%d",&n);



    for(i=1;i<=n;i++)

    {

        if(i<=9)

            digit++;



        else if(100<=i && i<=999)

            digit++;



        else if(10000<=i && i<=99999)///100000

            digit++;

    }



    printf("%d",digit);



    return 0;

}
// Slower C++ solution:
#include <iostream>

#include<bits/stdc++.h>

using namespace std;



int main()

{







int n;

int counter=0;

cin>>n;

for(int i=1;i<=n;i++)

{





    string str=to_string(i);

    if(str.size()%2!=0)counter++;











}

cout<<counter;

}


// Faster C++ solution for the same problem (measured speedup: 5.393551805472924x):
#include<stdio.h>



int main()

{

    int n,i,digit=0,mod,num;



    scanf("%d",&n);



    for(i=1;i<=n;i++)

    {

        if(i<=9)

            digit++;



        else if(100<=i && i<=999)

            digit++;



        else if(10000<=i && i<=99999)///100000

            digit++;

    }



    printf("%d",digit);



    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define ll long long

int main()

{

    ll n,i,j,k,l,a,b,c,d;

    string s1;

    cin>>n;

    c=0;

    for(i=1;i<=n;i++)

    {

        stringstream ss;

        ss<<i;

        ss>>s1;

        k=s1.size();

        if(k%2!=0){c++;}

    }

    cout<<c<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 6.126271839625992x):
#include<stdio.h>



int main()

{

    int n,i,digit=0,mod,num;



    scanf("%d",&n);



    for(i=1;i<=n;i++)

    {

        if(i<=9)

            digit++;



        else if(100<=i && i<=999)

            digit++;



        else if(10000<=i && i<=99999)///100000

            digit++;

    }



    printf("%d",digit);



    return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main()

{

    long long int n,c=0;

    cin>>n;

    if(n<10)



    {

        cout<<n<<endl;

        return 0;

    }

    if(n>=10)

    {

        c+=9;

    }

    if(n>=100&&n<1000)

    {

        c+=(n-99);

    }

    if(n>=1000)

    {

        c+=900;

    }



    if(n>=10000&&n<100000)

    {

       c+=(n-9999);

    }

    if(n>=100000)

    {

        c+=90000;

    }

    cout<<c<<endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.218810381765622x):
#include<stdio.h>



int main()

{

    int n,i,digit=0,mod,num;



    scanf("%d",&n);



    for(i=1;i<=n;i++)

    {

        if(i<=9)

            digit++;



        else if(100<=i && i<=999)

            digit++;



        else if(10000<=i && i<=99999)///100000

            digit++;

    }



    printf("%d",digit);



    return 0;

}
// Slower C++ solution:
#include<iostream>



using namespace std;

int main()

{

    int n,i,cnt=0;

    cin>>n;

    for(i=1; i<=n; i++)

    {

        int tmp=i,sum= 0;

        while(tmp!=0)

        {

            sum++;



            tmp=(tmp/10);

        }

        if(sum%2 !=0)



            cnt++;

    }

    cout<<cnt<<endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.282257167169908x):
#include<stdio.h>



int main()

{

    int n,i,digit=0,mod,num;



    scanf("%d",&n);



    for(i=1;i<=n;i++)

    {

        if(i<=9)

            digit++;



        else if(100<=i && i<=999)

            digit++;



        else if(10000<=i && i<=99999)///100000

            digit++;

    }



    printf("%d",digit);



    return 0;

}
// Slower C++ solution:
/***

*	author  :_shamim

*	created : 05.05.2020

*

***/



#include <iostream>

#include <string.h>

#include <stdio.h>

#include <math.h>

#include <list>

#include <set>

#include <queue>

#include <iterator>

#include <bitset>

#include <bits/stdc++.h>

#include <vector>

#include <algorithm>

#define ll             long long

#define _              ios_base::sync_with_stdio(0);cin.tie(0);

#define loop           for(i=0;i<n;i++)

#define pb             push_back

#define tc()           int t;cin>>t;while(t--)          



using namespace std;



ll i,j,temp;



int main()

{_

	int n,cnt=0;



	cin>>n;

	for(i=1;i<=n;i++){

		if((i>=1 && i<=9) || (i>=100 && i<=999) ||(i>=10000 && i<=99999)){

			cnt++;

		}

	}

	cout<<cnt<<endl;







	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.307456730116605x):
#include<stdio.h>



int main()

{

    int n,i,digit=0,mod,num;



    scanf("%d",&n);



    for(i=1;i<=n;i++)

    {

        if(i<=9)

            digit++;



        else if(100<=i && i<=999)

            digit++;



        else if(10000<=i && i<=99999)///100000

            digit++;

    }



    printf("%d",digit);



    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

#define fastIO ios::sync_with_stdio(0), cin.tie(0)

#define endl '\n'

#define ft first

#define sd second

#define pb push_back

#define pob pop_back()

#define pf push_front

#define pof pop_front()

typedef long long ll;

typedef pair<int,int> pii;

typedef pair<char,char> pcc;

typedef pair<long long,long long> pll;



int main() {

    fastIO;

    int n, aux, rta = 0;

    cin >> n;

    for(int i = 1; i <= n; i++){

        aux = log10(i)+1;

        if(aux%2) rta++;

    }

    cout << rta << endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 5.4606570562113665x):
#include<stdio.h>



int main()

{

    int n,i,digit=0,mod,num;



    scanf("%d",&n);



    for(i=1;i<=n;i++)

    {

        if(i<=9)

            digit++;



        else if(100<=i && i<=999)

            digit++;



        else if(10000<=i && i<=99999)///100000

            digit++;

    }



    printf("%d",digit);



    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <string>

#include "bits/stdc++.h"

using namespace std;



int main() 

{

    int n, count=0;

    cin >> n;

    for(int i=1; i<n+1; i++) {

        stringstream st_i;

        st_i << i;

        if(st_i.str().length()%2 == 1) {

            count++;

        }

    }

    cout << count << endl; 

}


// Faster C++ solution for the same problem (measured speedup: 1.1124786312658557x):
#include <iostream>

#include <algorithm>

#include <string>

#include "bits/stdc++.h"

using namespace std;



int main() 

{

    int n, count=0;

    cin >> n;

    string st_i ;

    for(int i=1; i<n+1; i++) {

        string st_i = to_string(i);

        if(st_i.length()%2 == 1) {

            count++;

        }

    }

    cout << count << endl; 

}
// Slower C++ solution:
///AJoy Sarker ,CSE JAHANGIRNAGAR UNIVERSITY 48 Batch

#include<bits/stdc++.h>

using namespace std;

#define SORT(c) sort((c).begin(),(c).end());

#define pb push_back

#define MP make_pair

#define pii pair<int,int>

#define pcc pair<char,char>

#define pic pair<int,char>

#define pci pair<char,int>

#define VS vector<string>

#define VI vector<int>

#define MIN(a,b) (a>b?b:a)

#define MAX(a,b) (a>b?a:b)

#define pi 3.141592653589793

#define in scanf

#define out printf

#define ll long long

#define ull unsigned long long

#define w(x) int x;cin>>x;while(x--)

#define fast ios_base::sync_with_stdio(0)

#define FOR(i,a,b) for( int i=(a),_b=(b);i<=_b;i++)

#define DOW(i,b,a) for( int i=(b),_a=(a);i>=_a;i--)

#define sz size()

typedef unsigned long long UL;

template<typename T>inline T  S(T a)

{

    return a*a;

}

template<class T>inline string tostring(T a)

{

    ostringstream os("");

    os << a;

    return os.str();

}

template<typename T>inline ll tolong(T a)

{

    ll res;

    istringstream os(a);

    os>>res;

    return res;

}

template<typename T>inline T gcd(T a, T b)

{

    if (b == 0)return a;

    else return gcd(b, a % b);

}

template<typename T>inline T bigmod(T a, T b, T m)

{

    if (b == 0)return 1;

    else if (b % 2 == 0)return S(bigmod(a, b / 2, m)) % m;

    else return (a % m*bigmod(a, b - 1, m)) % m;

}

const int inf = (int)1e9 + 5;

const ll linf = (ll)1e16 + 5;

const ll mod = (ll)1e9 + 7;

#define N 20000009

bool prime[N];

vector<ll> prm;

void seive ()

{



    memset(prime, true, sizeof(prime));



    for( ll i=2; i*i<=N; i++)

    {

        if (prime[i] == true)

        {

            prm.pb(i);

            for (ll j=i*i; j<=N; j += i)

                prime[j] = false;

        }

    }

}

void pr (int f)

{

    if(f==1)

        cout<<"Yes\n";

    else

        cout<<"No\n";

}

map<int,int>mp;

set<int> s;

int vis[111];

int main()

{

    fast;

     ll n,c=0;

     cin>>n;

     for(ll i=1;i<=n;i++)

     {

         string x=tostring(i);

         if((x.sz)%2) c++;

     }

     cout<<c<<endl;

}






// Faster C++ solution for the same problem (measured speedup: 1.1319874389371258x):
#include<bits/stdc++.h>

using namespace std;

#define ll long long

int main()

{

    ll n,p,q,ct,x,z;

    cin>>n;

    ct=0;

    for(ll i=1;i<=n;i++)

    {

        x=i; z=0;

        while(x!=0)

        {

            x=x/10; z++;

        }

        if(z%2==1) ct++;

    }

    cout<<ct<<endl;

}
// Slower C++ solution:
///AJoy Sarker ,CSE JAHANGIRNAGAR UNIVERSITY 48 Batch

#include<bits/stdc++.h>

using namespace std;

#define SORT(c) sort((c).begin(),(c).end());

#define pb push_back

#define MP make_pair

#define pii pair<int,int>

#define pcc pair<char,char>

#define pic pair<int,char>

#define pci pair<char,int>

#define VS vector<string>

#define VI vector<int>

#define MIN(a,b) (a>b?b:a)

#define MAX(a,b) (a>b?a:b)

#define pi 3.141592653589793

#define in scanf

#define out printf

#define ll long long

#define ull unsigned long long

#define w(x) int x;cin>>x;while(x--)

#define fast ios_base::sync_with_stdio(0)

#define FOR(i,a,b) for( int i=(a),_b=(b);i<=_b;i++)

#define DOW(i,b,a) for( int i=(b),_a=(a);i>=_a;i--)

#define sz size()

typedef unsigned long long UL;

template<typename T>inline T  S(T a)

{

    return a*a;

}

template<class T>inline string tostring(T a)

{

    ostringstream os("");

    os << a;

    return os.str();

}

template<typename T>inline ll tolong(T a)

{

    ll res;

    istringstream os(a);

    os>>res;

    return res;

}

template<typename T>inline T gcd(T a, T b)

{

    if (b == 0)return a;

    else return gcd(b, a % b);

}

template<typename T>inline T bigmod(T a, T b, T m)

{

    if (b == 0)return 1;

    else if (b % 2 == 0)return S(bigmod(a, b / 2, m)) % m;

    else return (a % m*bigmod(a, b - 1, m)) % m;

}

const int inf = (int)1e9 + 5;

const ll linf = (ll)1e16 + 5;

const ll mod = (ll)1e9 + 7;

#define N 20000009

bool prime[N];

vector<ll> prm;

void seive ()

{



    memset(prime, true, sizeof(prime));



    for( ll i=2; i*i<=N; i++)

    {

        if (prime[i] == true)

        {

            prm.pb(i);

            for (ll j=i*i; j<=N; j += i)

                prime[j] = false;

        }

    }

}

void pr (int f)

{

    if(f==1)

        cout<<"Yes\n";

    else

        cout<<"No\n";

}

map<int,int>mp;

set<int> s;

int vis[111];

int main()

{

    fast;

     ll n,c=0;

     cin>>n;

     for(ll i=1;i<=n;i++)

     {

         string x=tostring(i);

         if((x.sz)%2) c++;

     }

     cout<<c<<endl;

}






// Faster C++ solution for the same problem (measured speedup: 1.1313050386880636x):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n,c,s=0;

    cin>>n;

    int i,temp;

    for(i=1;i<=n;i++)

    {

        temp=i;c=0;

        while(temp!=0)

        {

            temp=temp/10;

            c++;

        }

        if(c%2==1) s++;

    }

    cout<<s<<endl;

    return 0;

}
// Slower C++ solution:
///AJoy Sarker ,CSE JAHANGIRNAGAR UNIVERSITY 48 Batch

#include<bits/stdc++.h>

using namespace std;

#define SORT(c) sort((c).begin(),(c).end());

#define pb push_back

#define MP make_pair

#define pii pair<int,int>

#define pcc pair<char,char>

#define pic pair<int,char>

#define pci pair<char,int>

#define VS vector<string>

#define VI vector<int>

#define MIN(a,b) (a>b?b:a)

#define MAX(a,b) (a>b?a:b)

#define pi 3.141592653589793

#define in scanf

#define out printf

#define ll long long

#define ull unsigned long long

#define w(x) int x;cin>>x;while(x--)

#define fast ios_base::sync_with_stdio(0)

#define FOR(i,a,b) for( int i=(a),_b=(b);i<=_b;i++)

#define DOW(i,b,a) for( int i=(b),_a=(a);i>=_a;i--)

#define sz size()

typedef unsigned long long UL;

template<typename T>inline T  S(T a)

{

    return a*a;

}

template<class T>inline string tostring(T a)

{

    ostringstream os("");

    os << a;

    return os.str();

}

template<typename T>inline ll tolong(T a)

{

    ll res;

    istringstream os(a);

    os>>res;

    return res;

}

template<typename T>inline T gcd(T a, T b)

{

    if (b == 0)return a;

    else return gcd(b, a % b);

}

template<typename T>inline T bigmod(T a, T b, T m)

{

    if (b == 0)return 1;

    else if (b % 2 == 0)return S(bigmod(a, b / 2, m)) % m;

    else return (a % m*bigmod(a, b - 1, m)) % m;

}

const int inf = (int)1e9 + 5;

const ll linf = (ll)1e16 + 5;

const ll mod = (ll)1e9 + 7;

#define N 20000009

bool prime[N];

vector<ll> prm;

void seive ()

{



    memset(prime, true, sizeof(prime));



    for( ll i=2; i*i<=N; i++)

    {

        if (prime[i] == true)

        {

            prm.pb(i);

            for (ll j=i*i; j<=N; j += i)

                prime[j] = false;

        }

    }

}

void pr (int f)

{

    if(f==1)

        cout<<"Yes\n";

    else

        cout<<"No\n";

}

map<int,int>mp;

set<int> s;

int vis[111];

int main()

{

    fast;

     ll n,c=0;

     cin>>n;

     for(ll i=1;i<=n;i++)

     {

         string x=tostring(i);

         if((x.sz)%2) c++;

     }

     cout<<c<<endl;

}






// Faster C++ solution for the same problem (measured speedup: 1.1325624631704958x):
#include<bits/stdc++.h>

using namespace std;

typedef long long int ll;

int main()

{

    ll n,g,x,t,h,k=0,f,l=0;

    cin>>n;

    if(n < 10)

    {

        cout<<n<<endl;

    }

    else if(n < 100)

    {

        cout<<"9"<<endl;

    }

    else if(n < 1000)

    {

        cout<<n-90<<endl;

    }

    else if(n < 10000)

    {

        cout<<"909"<<endl;

    }

    else if(n >= 10000 && n < 100000)

    {

        cout<<n-9090<<endl;

    }

    else if(n == 100000)

    {

        cout<<n-9091<<endl;

    }



}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int countDigit(int n){

    return floor(log10(n) + 1);

}



int main()

{

    int n;

    cin >> n;

    int ans = 0;

    for(int i = 1; i <= n; i++) {

        if(countDigit(i) % 2)ans++;

    }

    cout << ans << endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 5.2228396645560675x):
#include<stdio.h>

int main()

{

    int n,i,j,count1,count2=0,d;

    scanf("%d",&n);

    for(i=1; i<=n; i++)

    {

        d=i;

        count1=0;

        while(d>0)

        {

            d/=10;

            count1++;

        }



        if(count1%2!=0) count2++;

    }

    printf("%d",count2);

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



#define loop(i,n) for(int i = 0;i < int(n);i++)

#define rloop(i,n) for(int i = int(n);i >= 0;i--)

#define range(i,a,b) for(int i = int(a);i <= int(b);i++)

#define SZ(c) int(c.size())

#define ALL(c) c.begin(), c.end()

#define RALL(c) c.rbegin(), c.rend()

#define PI acos(-1)

#define pb push_back

#define mp make_pair

#define fr first

#define sc second

#define sfi1(v) scanf("%d",&v)

#define sfi2(v1,v2) scanf("%d %d",&v1,&v2)

#define sfi3(v1,v2,v3) scanf("%d %d %d",&v1,&v2,&v3)

#define sfll1(v) scanf("%I64d",&v);

#define sfll2(v1,v2) scanf("%I64d %I64d",&v1,&v2)

#define sfll3(v1,v2,v3) scanf("%I64d %I64d %I64d",&v1,&v2,&v3)

#define endl '\n'



typedef vector<int> vi;

typedef vector<pair<int,int> > vii;

typedef long long ll;

typedef pair<int, int> pii;



bool good(int n){

    int ret = 0;

    while(n){

        n /= 10;

        ret++;

    }

    return (ret&1);

}



int main()

{



#ifndef ONLINE_JUDGE

	//freopen("in.in", "r", stdin);

	//freopen("out.in", "w", stdout);

#endif

	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);



    int n;

    cin >> n;

    int ans = 0;

    range(i,1,n)ans += good(i);

    cout << ans << endl;





    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.1506975868855625x):
#include<stdio.h>

int main()

{

    int n,i,j,count1,count2=0,d;

    scanf("%d",&n);

    for(i=1; i<=n; i++)

    {

        d=i;

        count1=0;

        while(d>0)

        {

            d/=10;

            count1++;

        }



        if(count1%2!=0) count2++;

    }

    printf("%d",count2);

}
// Slower C++ solution:
/*	MASTER HAS FAILED MORE TIMES

	THAN BEGINNER HAS EVER TRIED

*/



#include <bits/stdc++.h>



using namespace std;



#define endl             '\n'

#define all(a)           a.begin(), a.end()

#define mem(a, n)        memset(a, n, sizeof(a))

#define Unique(n)        (n).erase(unique(all(n)), (n).end())

#define NumofDigits(n)   ((long long)log10(n)+1)

#define repeat(i, a, n)  for(int i=a; i<n; i++)

#define isPowerOfTwo(n)  (n && !(n & (n - 1)))



typedef long long ll;

typedef long double ld;



int sieve(int n);

unsigned long long pow(long long base, long long power);

long long gcd(long long a, long long b){ return a%b ? gcd(b, a%b) : b; }

long long lcm(long long a, long long b){ return a*b/gcd(a, b); }



void quicken(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); }

void file(){

    #ifdef ONLINE_JUDGE

    freopen("input.txt", "r", stdin);

    freopen("output.txt", "w", stdout);

    #endif /*ONLINE_JUDGE*/

}



int main(){

    quicken();



    int n, c=0; cin >> n;

    repeat(i, 1, n+1)

        if(NumofDigits(i)&1) c++;

    cout << c;



    return 0;

}



unsigned long long pow(long long base, long long power){ /// mod?

    if(power==0) return 1;

    if(power==1) return base;



    unsigned long long ans = pow(base, power/2); /// mod?

    ans *= ans; /// ((ans%mod)*(ans%mod))%mod;



    if(power&1) return ans*base; /// ((ans%mod)*(base%mod))%mod;

    return ans;

}



int sieve(int n){

    int c = 0;

    vector<bool> isPrime(n+1, true);

    isPrime[0] = isPrime[1] = 0;



    for(long long i=2; i*i<=n; i++)

        if(isPrime[i])

            for(long long j=i*2; j<=n; j+=i)

                isPrime[j] = 0;

    repeat(i, 0, n+1)

        if(isPrime[i]) c++;

    return c; /// primeCount [1:n]

}


// Faster C++ solution for the same problem (measured speedup: 5.284235127859563x):
#include<stdio.h>

int main()

{

    int n,i,j,count1,count2=0,d;

    scanf("%d",&n);

    for(i=1; i<=n; i++)

    {

        d=i;

        count1=0;

        while(d>0)

        {

            d/=10;

            count1++;

        }



        if(count1%2!=0) count2++;

    }

    printf("%d",count2);

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int const N=1e5+5, M=4, OO = 0x3f3f3f3f;



int n,ans;



int main()

{

//    freopen("input.txt","rt",stdin);

//    freopen("output.txt","wt",stdout);

//    freopen("mo3gza.txt","wt",stdout);

    scanf("%d",&n);

    for(int i=1; i<=n; i++)

    {

        if(to_string(i).size()%2)

            ans++;

    }

    printf("%d\n",ans);

    return 0;

}








// Faster C++ solution for the same problem (measured speedup: 5.370211652406511x):
#include<stdio.h>

int main()

{

    int n,i,j,count1,count2=0,d;

    scanf("%d",&n);

    for(i=1; i<=n; i++)

    {

        d=i;

        count1=0;

        while(d>0)

        {

            d/=10;

            count1++;

        }



        if(count1%2!=0) count2++;

    }

    printf("%d",count2);

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



void init()

{

    cin.tie(0);

    cin.sync_with_stdio(0);

}









int main()

{

    init();

    int n ;

    cin>>n;

    //int v=1;

    int odd=0;

    for(int i =1;i<=n;i++){

            int d=0;

            int v=i;



        while(v>0){

            v=v/10;

             d++;



        }

        if(d%2!=0) odd++;

    }

    cout<<odd;

   }


// Faster C++ solution for the same problem (measured speedup: 5.147934276151839x):
#include<stdio.h>

int main()

{

    int n,i,j,count1,count2=0,d;

    scanf("%d",&n);

    for(i=1; i<=n; i++)

    {

        d=i;

        count1=0;

        while(d>0)

        {

            d/=10;

            count1++;

        }



        if(count1%2!=0) count2++;

    }

    printf("%d",count2);

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int main()

{

    int n,c=0;

    cin>>n;

    for(int i=1;i<=n;++i){

        c+=(to_string(i).size()%2);

    }

    cout<<c<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.4171415837350665x):
#include<stdio.h>

int main()

{

    int n,i,j,count1,count2=0,d;

    scanf("%d",&n);

    for(i=1; i<=n; i++)

    {

        d=i;

        count1=0;

        while(d>0)

        {

            d/=10;

            count1++;

        }



        if(count1%2!=0) count2++;

    }

    printf("%d",count2);

}