import std.stdio, std.conv, std.string, std.array, std.algorithm,
    std.numeric, std.math, std.range;

void main()
{
    long n;
    readf("%d", &n);

    long ans = 0;
    foreach (x; 1 .. 10)
    {
        if (x > n)
        {
            break;
        }
        ans++;
    }
    foreach (x; 100 .. 1000)
    {
        if (x > n)
        {
            break;
        }
        ans++;
    }
    foreach (x; 10000 .. 100000)
    {
        if (x > n)
        {
            break;
        }
        ans++;
    }
    writeln(ans);
}
