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

using namespace std;

typedef long long ll;

ll n;

ll dep(ll x)

{

    ll ret=0;

    while(x)

    {

        x/=10;

        ret++;

    }

    return ret;

}

void solve()

{

    ll ans=0;

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

    {

        ll w=dep(i);

        if(w&1)

        {

            ans++;

        }

    }

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

}

int main()

{

    scanf("%lld",&n);

    solve();

}


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

int main()

{

  int N=0,m=0,c=0,count=0;

  scanf("%d",&N);

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

  {

   

    for(m=i;m!=0;++c)

    {

      m=m/10;

    }

    if(c%2!=0)

    {

      count++;

    }

    c=0;

  }

  printf("%d ",count);

  return 0;

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

 

using namespace std;

 

int main()

{

    int n,cnt;

    cin>>n;

    for(int i=6;i>-1;i--)

    {

 

      if((int)(n/pow(10,i))!=0)

        {cnt=i+1;

        //cout<<n/pow(10,i)<<endl;

        break;

        }

    }

    switch(cnt)

    {

      case 1:cout<<n;

            break;

      case 2:cout<<"9";

            break;

      case 3:cout<<n-90;

            break;

    case 4:cout<<"909";

            break;

    case 5:cout<<n-9090;

            break;

    case 6:cout<<"90909";

            break;

    }

    //cout<<cnt;

    return 0;

}

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

int main()

{

  int N=0,m=0,c=0,count=0;

  scanf("%d",&N);

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

  {

   

    for(m=i;m!=0;++c)

    {

      m=m/10;

    }

    if(c%2!=0)

    {

      count++;

    }

    c=0;

  }

  printf("%d ",count);

  return 0;

  }
// Slower C++ solution:
// uneven numbers.cpp : This file contains the 'main' function. Program execution begins and ends there.

//



#include <iostream>

#include <algorithm>

#include <string>

using namespace std;

int main()

{

	int n , c = 0; 

	cin >> n;

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

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

			c++;

			

	}

	cout << c;

}


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

int main()

{

  int N=0,m=0,c=0,count=0;

  scanf("%d",&N);

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

  {

   

    for(m=i;m!=0;++c)

    {

      m=m/10;

    }

    if(c%2!=0)

    {

      count++;

    }

    c=0;

  }

  printf("%d ",count);

  return 0;

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

using namespace std;

int main(){



 int n,sum=0;

 cin>>n;

 if (n<10)

    sum=n;

    else if (n>9&&n<100)

        sum=9;

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

        sum=n-90;

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

        sum=909;

        else if(n>9999&&n<100000)//10000--99999

            sum=n-9090;

    else sum=90909;

    cout<<sum<<endl;

 }

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

int main()

{

  int N=0,m=0,c=0,count=0;

  scanf("%d",&N);

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

  {

   

    for(m=i;m!=0;++c)

    {

      m=m/10;

    }

    if(c%2!=0)

    {

      count++;

    }

    c=0;

  }

  printf("%d ",count);

  return 0;

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

using namespace std;

int digitCnt(int p)

{

    int i,c=0,ans=0;

    while(p>0)

    {

        p=p/10;

        c++;

    }

    if(c%2!=0)

    {

        ans++;

    }

    //cout<<ans;

    return ans;



}

int main()

{

    int n,m=0,i;

    cin>>n;

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

    {

        m=m+digitCnt(i);

    }

cout<<m<<endl;





}


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

int main()

{

  int N=0,m=0,c=0,count=0;

  scanf("%d",&N);

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

  {

   

    for(m=i;m!=0;++c)

    {

      m=m/10;

    }

    if(c%2!=0)

    {

      count++;

    }

    c=0;

  }

  printf("%d ",count);

  return 0;

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

using namespace std;

#define ll long long

ll a[60];

int main()

{

    ll n,i,l;

    cin>>n;

    string s;

    s=to_string(n);

    l=s.size();

    if(s.size()==1)

       cout<<n<<endl;

    else if(s.size()==2)

       cout<<9<<endl;

    else if(s.size()==3)

       cout<<9+(n-100)+1<<endl;

    else if(s.size()==4)

       cout<<9+900<<endl;

    else if(s.size()==5)

       cout<<9+900+(n-10000)+1<<endl;

    else if(s.size()==6)

       cout<<9+900+90000<<endl;

}




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

int main()

{

  int N=0,m=0,c=0,count=0;

  scanf("%d",&N);

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

  {

   

    for(m=i;m!=0;++c)

    {

      m=m/10;

    }

    if(c%2!=0)

    {

      count++;

    }

    c=0;

  }

  printf("%d ",count);

  return 0;

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

using namespace std;

typedef long long ll;

int main()

{

    ll n;

    cin>>n;

    ll d=0;

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

    {

        ll c=i;

        ll sum=0;

        while(c!=0)

        {

            sum++;

            c=c/10;

        }

        if(sum%2==1)

        {

          d++;

        }

    }

    cout<<d<<endl;

return 0;

}


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

int main()

{

  int N=0,m=0,c=0,count=0;

  scanf("%d",&N);

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

  {

   

    for(m=i;m!=0;++c)

    {

      m=m/10;

    }

    if(c%2!=0)

    {

      count++;

    }

    c=0;

  }

  printf("%d ",count);

  return 0;

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

using namespace std;

int main()

{

    int a,p,i,j,k,n=0;

     string s;

     cin>>s;

     for(i=0;i<s.size();i++){

        n=n*10+s[i]-'0';

     }

     a=s.size();

     if(a==6){

        p=9+(999-100+1)+(99999-10000+1);

     }

     else if(a==5){p=9+(999-100+1)+n-10000+1;}

      else if(a==4){p=9+(999-100+1);}

       else if(a==3){p=9+n-100+1;}

        else if(a==2){p=9;}

         else if(a==1){p=n-1+1;}

         cout<<p<<endl;









}




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

int main()

{

  int N=0,m=0,c=0,count=0;

  scanf("%d",&N);

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

  {

   

    for(m=i;m!=0;++c)

    {

      m=m/10;

    }

    if(c%2!=0)

    {

      count++;

    }

    c=0;

  }

  printf("%d ",count);

  return 0;

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



                         بسم الله الرحمن الرحيم

                     Author: Mst: Mhamuda Khatun

                               RUCSE27



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



#include<bits/stdc++.h>

using namespace std;

#define ull unsigned long long

#define ll long long

#define pi 2*acos(0.0)

#define f first

#define s second

#define pb push_back

#define gap ' '

#define fastio {ios_base::sync_with_stdio(false);cin.tie(NULL);}

#define mod 1000000007

#define MAX 1000000000000

#define N 305



int main()

{

    fastio;

    int n,len,i,cnt=0;

    cin>>n;

    string x;

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

    {

        x=to_string(i);

        len=x.size();



        if(len%2==1)

            cnt++;

    }

    cout<<cnt;

    cout<<"\n";

    return 0;   //:D

}






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

int main()

{

  int N=0,m=0,c=0,count=0;

  scanf("%d",&N);

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

  {

   

    for(m=i;m!=0;++c)

    {

      m=m/10;

    }

    if(c%2!=0)

    {

      count++;

    }

    c=0;

  }

  printf("%d ",count);

  return 0;

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

}


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

int main()

{

  int N=0,m=0,c=0,count=0;

  scanf("%d",&N);

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

  {

   

    for(m=i;m!=0;++c)

    {

      m=m/10;

    }

    if(c%2!=0)

    {

      count++;

    }

    c=0;

  }

  printf("%d ",count);

  return 0;

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

using namespace std;

typedef long long ll;

ll n;

ll dep(ll x)

{

    ll ret=0;

    while(x)

    {

        x/=10;

        ret++;

    }

    return ret;

}

void solve()

{

    ll ans=0;

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

    {

        ll w=dep(i);

        if(w&1)

        {

            ans++;

        }

    }

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

}

int main()

{

    scanf("%lld",&n);

    solve();

}


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

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

 

using namespace std;

 

int main()

{

    int n,cnt;

    cin>>n;

    for(int i=6;i>-1;i--)

    {

 

      if((int)(n/pow(10,i))!=0)

        {cnt=i+1;

        //cout<<n/pow(10,i)<<endl;

        break;

        }

    }

    switch(cnt)

    {

      case 1:cout<<n;

            break;

      case 2:cout<<"9";

            break;

      case 3:cout<<n-90;

            break;

    case 4:cout<<"909";

            break;

    case 5:cout<<n-9090;

            break;

    case 6:cout<<"90909";

            break;

    }

    //cout<<cnt;

    return 0;

}

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

    }
// Slower C++ solution:
// uneven numbers.cpp : This file contains the 'main' function. Program execution begins and ends there.

//



#include <iostream>

#include <algorithm>

#include <string>

using namespace std;

int main()

{

	int n , c = 0; 

	cin >> n;

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

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

			c++;

			

	}

	cout << c;

}


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

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

using namespace std;

int main(){



 int n,sum=0;

 cin>>n;

 if (n<10)

    sum=n;

    else if (n>9&&n<100)

        sum=9;

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

        sum=n-90;

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

        sum=909;

        else if(n>9999&&n<100000)//10000--99999

            sum=n-9090;

    else sum=90909;

    cout<<sum<<endl;

 }

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

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

using namespace std;

int digitCnt(int p)

{

    int i,c=0,ans=0;

    while(p>0)

    {

        p=p/10;

        c++;

    }

    if(c%2!=0)

    {

        ans++;

    }

    //cout<<ans;

    return ans;



}

int main()

{

    int n,m=0,i;

    cin>>n;

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

    {

        m=m+digitCnt(i);

    }

cout<<m<<endl;





}


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

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

using namespace std;

#define ll long long

ll a[60];

int main()

{

    ll n,i,l;

    cin>>n;

    string s;

    s=to_string(n);

    l=s.size();

    if(s.size()==1)

       cout<<n<<endl;

    else if(s.size()==2)

       cout<<9<<endl;

    else if(s.size()==3)

       cout<<9+(n-100)+1<<endl;

    else if(s.size()==4)

       cout<<9+900<<endl;

    else if(s.size()==5)

       cout<<9+900+(n-10000)+1<<endl;

    else if(s.size()==6)

       cout<<9+900+90000<<endl;

}




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

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

using namespace std;

typedef long long ll;

int main()

{

    ll n;

    cin>>n;

    ll d=0;

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

    {

        ll c=i;

        ll sum=0;

        while(c!=0)

        {

            sum++;

            c=c/10;

        }

        if(sum%2==1)

        {

          d++;

        }

    }

    cout<<d<<endl;

return 0;

}


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

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

using namespace std;

int main()

{

    int a,p,i,j,k,n=0;

     string s;

     cin>>s;

     for(i=0;i<s.size();i++){

        n=n*10+s[i]-'0';

     }

     a=s.size();

     if(a==6){

        p=9+(999-100+1)+(99999-10000+1);

     }

     else if(a==5){p=9+(999-100+1)+n-10000+1;}

      else if(a==4){p=9+(999-100+1);}

       else if(a==3){p=9+n-100+1;}

        else if(a==2){p=9;}

         else if(a==1){p=n-1+1;}

         cout<<p<<endl;









}




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

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



                         بسم الله الرحمن الرحيم

                     Author: Mst: Mhamuda Khatun

                               RUCSE27



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



#include<bits/stdc++.h>

using namespace std;

#define ull unsigned long long

#define ll long long

#define pi 2*acos(0.0)

#define f first

#define s second

#define pb push_back

#define gap ' '

#define fastio {ios_base::sync_with_stdio(false);cin.tie(NULL);}

#define mod 1000000007

#define MAX 1000000000000

#define N 305



int main()

{

    fastio;

    int n,len,i,cnt=0;

    cin>>n;

    string x;

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

    {

        x=to_string(i);

        len=x.size();



        if(len%2==1)

            cnt++;

    }

    cout<<cnt;

    cout<<"\n";

    return 0;   //:D

}






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

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

}


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

    }
// 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: 1.165489853702947x):
#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;

}
// 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: 1.1642596953730089x):
#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;

}
// 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: 1.148491488799851x):
/***

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

}
// 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: 1.1414192658852165x):
#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;

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

}

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

}


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

}