stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

#define endl              "\n"

#define pb              push_back

#define fir               first

#define sec               second

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

#define sz(v)            ((int)((v).size()))

#define ll              long long

#define ld              long double

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

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

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

typedef vector<int> vi;

typedef deque<int> de;

void origi() {

    ios_base::sync_with_stdio(false);

    cin.tie(nullptr), cout.tie(nullptr);

}

int dig(int n) {

    int re = 0;

    while (n > 0)

        n /= 10, re++;

    return re;

}

void tiranga() {

    int n;

    cin >> n;

    int arr[] = { 0,9,0,909,0,90909 };

    if (!(dig(n) % 2))

        cout << arr[dig(n) - 1];

    else {

        int digits = dig(n);

        if (digits == 1)

            cout << n;

        else {

            int res = arr[digits - 2];

            int temp = 1;

            lp(i, digits - 1)

                temp *= 10;

            res += n - temp;

            cout << ++res;

        }

    }

}

int main() {

#ifndef ONLINE_JUDGE.

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

#else

#endif

    

    origi();

    tiranga();

    //cout << sumOfDig(123654);

   // genLarge(10, 10);

   // genSmall(10);



}


// Faster C++ solution for the same problem (measured speedup: 5.088009389121166x):
#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:
///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: 5.940701382745684x):
#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 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;

}


// Faster C++ solution for the same problem (measured speedup: 5.074000847916229x):
#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,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;

}








// Faster C++ solution for the same problem (measured speedup: 5.082262695477436x):
#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;

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;

    }



}


// Faster C++ solution for the same problem (measured speedup: 5.020950465836903x):
#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>

#pragma GCC optimize ("Ofast")

#pragma GCC optimize("O3")

#define lll __int128_t

#define ll long long int

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

#define FORr(i,a,b) for(ll(i)=(a);i>(ll)(b);i--)

#define rep(i,n) FOR(i,0,n)

#define rep1(i,n) FOR(i,1,n)

#define outi(a) printf("%lld\n",(a))

#define case(i) cout << "Case " << i << ": ";

#define pb push_back

#define in(n) ll n = read();

#define show(arr) for(auto a : arr) cout << a << " "; cout << endl;

#define inp(arr, n) ll arr[n] ; rep(i,n) arr[i] = read();

#define mp make_pair

#define f first 

#define s second 

#define mod 1000000007

#define modu(a) if(a>=mod) a-=mod;

#define test int tt = read(); rep(i,tt) solve(i+1);

using namespace std;

inline ll read()

{

    ll x=0; static ll p; p=1; static char c; c=getchar();

    while (!isdigit(c)) { if (c=='-') p=-1; c=getchar(); }

    while ( isdigit(c)) { x=(x<<1)+(x<<3)+(c-48); c=getchar(); }

    x*=p;

    return x;

}

int solve(int tt);

int main()

{

    //system("clear");

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

   ll ans = 0;

  in(N);

  rep1(i,N+1)

  {

      ll q = log10(i)+1;

      if(q&1) ans++;

  }

  cout << ans <<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.172951196561458x):
#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 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.4735876854373515x):
#include<stdio.h>

int main()

{

    int n, i , x, y,sum = 0;



    scanf("%d", &n);



    if(n > 0 && n < 10)

    {

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

        {

            sum++;

        }

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

    }

    else if(n >= 10 && n <= 99)

        printf("9\n");

    else if(n > 99 && n < 1000)

    {

        x = n - 90;

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

    }

    else if(n > 999 && n < 10000)

    {

        printf("909\n");

    }

    else if(n > 9999 && n < 100000)

    {

        y = n - 9090 ;

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

    }

    else if(n > 99999)

        printf("90909\n");



    return 0;

}
// 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.397982073681949x):
#include<stdio.h>

int main()

{

    int n, i , x, y,sum = 0;



    scanf("%d", &n);



    if(n > 0 && n < 10)

    {

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

        {

            sum++;

        }

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

    }

    else if(n >= 10 && n <= 99)

        printf("9\n");

    else if(n > 99 && n < 1000)

    {

        x = n - 90;

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

    }

    else if(n > 999 && n < 10000)

    {

        printf("909\n");

    }

    else if(n > 9999 && n < 100000)

    {

        y = n - 9090 ;

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

    }

    else if(n > 99999)

        printf("90909\n");



    return 0;

}
// 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.537930738922279x):
#include<stdio.h>

int main()

{

    int n, i , x, y,sum = 0;



    scanf("%d", &n);



    if(n > 0 && n < 10)

    {

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

        {

            sum++;

        }

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

    }

    else if(n >= 10 && n <= 99)

        printf("9\n");

    else if(n > 99 && n < 1000)

    {

        x = n - 90;

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

    }

    else if(n > 999 && n < 10000)

    {

        printf("909\n");

    }

    else if(n > 9999 && n < 100000)

    {

        y = n - 9090 ;

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

    }

    else if(n > 99999)

        printf("90909\n");



    return 0;

}
// 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.386678075434084x):
#include<stdio.h>

int main()

{

    int n, i , x, y,sum = 0;



    scanf("%d", &n);



    if(n > 0 && n < 10)

    {

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

        {

            sum++;

        }

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

    }

    else if(n >= 10 && n <= 99)

        printf("9\n");

    else if(n > 99 && n < 1000)

    {

        x = n - 90;

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

    }

    else if(n > 999 && n < 10000)

    {

        printf("909\n");

    }

    else if(n > 9999 && n < 100000)

    {

        y = n - 9090 ;

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

    }

    else if(n > 99999)

        printf("90909\n");



    return 0;

}
// 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.39508609667048x):
#include<stdio.h>

int main()

{

    int n, i , x, y,sum = 0;



    scanf("%d", &n);



    if(n > 0 && n < 10)

    {

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

        {

            sum++;

        }

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

    }

    else if(n >= 10 && n <= 99)

        printf("9\n");

    else if(n > 99 && n < 1000)

    {

        x = n - 90;

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

    }

    else if(n > 999 && n < 10000)

    {

        printf("909\n");

    }

    else if(n > 9999 && n < 100000)

    {

        y = n - 9090 ;

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

    }

    else if(n > 99999)

        printf("90909\n");



    return 0;

}
// 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.4337519057654955x):
#include<stdio.h>

int main()

{

    int n, i , x, y,sum = 0;



    scanf("%d", &n);



    if(n > 0 && n < 10)

    {

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

        {

            sum++;

        }

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

    }

    else if(n >= 10 && n <= 99)

        printf("9\n");

    else if(n > 99 && n < 1000)

    {

        x = n - 90;

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

    }

    else if(n > 999 && n < 10000)

    {

        printf("909\n");

    }

    else if(n > 9999 && n < 100000)

    {

        y = n - 9090 ;

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

    }

    else if(n > 99999)

        printf("90909\n");



    return 0;

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

using namespace std;

#define endl              "\n"

#define pb              push_back

#define fir               first

#define sec               second

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

#define sz(v)            ((int)((v).size()))

#define ll              long long

#define ld              long double

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

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

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

typedef vector<int> vi;

typedef deque<int> de;

void origi() {

    ios_base::sync_with_stdio(false);

    cin.tie(nullptr), cout.tie(nullptr);

}

int dig(int n) {

    int re = 0;

    while (n > 0)

        n /= 10, re++;

    return re;

}

void tiranga() {

    int n;

    cin >> n;

    int arr[] = { 0,9,0,909,0,90909 };

    if (!(dig(n) % 2))

        cout << arr[dig(n) - 1];

    else {

        int digits = dig(n);

        if (digits == 1)

            cout << n;

        else {

            int res = arr[digits - 2];

            int temp = 1;

            lp(i, digits - 1)

                temp *= 10;

            res += n - temp;

            cout << ++res;

        }

    }

}

int main() {

#ifndef ONLINE_JUDGE.

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

#else

#endif

    

    origi();

    tiranga();

    //cout << sumOfDig(123654);

   // genLarge(10, 10);

   // genSmall(10);



}


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

int main()

{

    int n, i , x, y,sum = 0;



    scanf("%d", &n);



    if(n > 0 && n < 10)

    {

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

        {

            sum++;

        }

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

    }

    else if(n >= 10 && n <= 99)

        printf("9\n");

    else if(n > 99 && n < 1000)

    {

        x = n - 90;

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

    }

    else if(n > 999 && n < 10000)

    {

        printf("909\n");

    }

    else if(n > 9999 && n < 100000)

    {

        y = n - 9090 ;

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

    }

    else if(n > 99999)

        printf("90909\n");



    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: 5.958917071135719x):
#include<stdio.h>

int main()

{

    int n, i , x, y,sum = 0;



    scanf("%d", &n);



    if(n > 0 && n < 10)

    {

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

        {

            sum++;

        }

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

    }

    else if(n >= 10 && n <= 99)

        printf("9\n");

    else if(n > 99 && n < 1000)

    {

        x = n - 90;

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

    }

    else if(n > 999 && n < 10000)

    {

        printf("909\n");

    }

    else if(n > 9999 && n < 100000)

    {

        y = n - 9090 ;

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

    }

    else if(n > 99999)

        printf("90909\n");



    return 0;

}
// Slower C++ solution:
#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;

}


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

int main()

{

    int n, i , x, y,sum = 0;



    scanf("%d", &n);



    if(n > 0 && n < 10)

    {

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

        {

            sum++;

        }

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

    }

    else if(n >= 10 && n <= 99)

        printf("9\n");

    else if(n > 99 && n < 1000)

    {

        x = n - 90;

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

    }

    else if(n > 999 && n < 10000)

    {

        printf("909\n");

    }

    else if(n > 9999 && n < 100000)

    {

        y = n - 9090 ;

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

    }

    else if(n > 99999)

        printf("90909\n");



    return 0;

}
// Slower C++ solution:
#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;

}








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

int main()

{

    int n, i , x, y,sum = 0;



    scanf("%d", &n);



    if(n > 0 && n < 10)

    {

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

        {

            sum++;

        }

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

    }

    else if(n >= 10 && n <= 99)

        printf("9\n");

    else if(n > 99 && n < 1000)

    {

        x = n - 90;

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

    }

    else if(n > 999 && n < 10000)

    {

        printf("909\n");

    }

    else if(n > 9999 && n < 100000)

    {

        y = n - 9090 ;

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

    }

    else if(n > 99999)

        printf("90909\n");



    return 0;

}