# ABC136B - Uneven Numbers

def main():

    n = int(eval(input()))

    d = len(str(n))

    if d == 6:

        ans = 9 + 900 + 90000

    elif d == 5:

        ans = 9 + 900 + n - 9999

    elif d == 4:

        ans = 9 + 900

    elif d == 3:

        ans = 9 + n - 99

    elif d == 2:

        ans = 9

    elif d == 1:

        ans = n

    print(ans)





if __name__ == "__main__":

    main()
# ABC136B - Uneven Numbers

def main():

    n = int(eval(input()))

    d = len(str(n))

    if d == 6:

        ans = 90909

    elif d in (4, 5):

        ans = 909 + max(0, n - 9999)

    elif d in (2, 3):

        ans = 9 + max(0, n - 99)

    else:

        ans = n

    print(ans)





if __name__ == "__main__":

    main()
# ABC136B - Uneven Numbers
def main():
    n = int(eval(input()))
    d = len(str(n))
    if d == 6:
        ans = 9 + 900 + 90000
    elif d == 5:
        ans = 9 + 900 + n - 9999
    elif d == 4:
        ans = 9 + 900
    elif d == 3:
        ans = 9 + n - 99
    elif d == 2:
        ans = 9
    elif d == 1:
        ans = n
    print(ans)


if __name__ == "__main__":
    main()

# ABC136B - Uneven Numbers
def main():
    n = int(eval(input()))
    d = len(str(n))
    if d == 6:
        ans = 90909
    elif d in (4, 5):
        ans = 909 + max(0, n - 9999)
    elif d in (2, 3):
        ans = 9 + max(0, n - 99)
    else:
        ans = n
    print(ans)


if __name__ == "__main__":
    main()

-        ans = 9 + 900 + 90000 -    elif d == 5: -        ans = 9 + 900 + n - 9999 -    elif d == 4: -        ans = 9 + 900 -    elif d == 3: -        ans = 9 + n - 99 -    elif d == 2: -        ans = 9 -    elif d == 1: +        ans = 90909 +    elif d in (4, 5): +        ans = 909 + max(0, n - 9999) +    elif d in (2, 3): +        ans = 9 + max(0, n - 99) +    else: