stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    int b=0,c,e=1,f=0,a,k=0,l;

    cin>>a;

    for(int i=a;i>0;i=i/10)

        b++;

    if(b>2)

    for(int k=b;k>1;k=k-2)

        {f=f+9*e;e=e*100;}

    else if(b==1)

        f=a;

    if(b%2!=0 && b>2)

        f=f+(a-e)+1;

    if(b==2)

        f=9;

    cout<<f;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main() { 

    int i,n,x,rem,cnt,flag=0;

    scanf("%d",&n);

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

        x=i;

        cnt=0;

        while(x!=0){

        rem=x%10;

        cnt++;

        x=x/10;

            

            }

        if(cnt%2==1){

            flag++;

        }

    }

    printf("%d",flag);

    return 0; 

    }

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



int n, sum = 0;

string s;



int main() {

	

	cin >> n;

	for(int i = n ; i >= 1 ; i--){

		s = to_string(i);

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

			sum++;

		}

	}

	cout << sum << endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <unordered_map>

#include <unordered_set>

#include <algorithm>

#include <iostream>

#include <numeric>

#include <cstring>

#include <cassert>

#include <string>

#include <vector>

#include <queue>

#include <deque>

#include <cmath>

#include <set>

#include <map>

#include <functional>



using namespace std;

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

#define     all(arr,n)      arr,arr+n

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

#define     rallv(v)        (v).rbegin(),(v).rend()

#define     m_p             make_pair

#define     ll              long long

#define     vi              vector<int>

#define     vll             vector<ll>

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

#define     pb              push_back

int dx[] = { -1, -1, -1, 0, 0, 1, 1, 1 };

int dy[] = { -1, 0, 1, -1, 1, -1, 0, 1 };

bool sortbysecdesc(const pair<string,ll> &a,const pair<string,ll> &b)

{

       return a.second>b.second;

}

int main() {

	int n,num=1,z=10;cin>>n;

	ll cnt=0;

	loop(n+1,i,1){

		if(i==z)num++,z*=10;

		if(num%2)cnt++;

	}

	cout<<cnt<<endl;

	return 0;

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
/***

*	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;

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}




// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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; 

}


// Optimized solution to the same problem (faster):
#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; 

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
///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;

}






// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}




// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
/*	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]

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}








// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

   }


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem: