N = int(eval(input()))



count = 0

for i in range(1, N+1):

  if len(str(i)) % 2 == 1:

    count += 1

print(count)    
def resolve():

    N = int(input())

    ans = 0

    for i in range(1, N+1):

        s = str(i)

        if len(s)%2 == 0:

            continue

        ans += 1

    return print(ans)



if __name__ == "__main__":

    resolve()

N = int(eval(input()))
count = 0
for i in range(1, N + 1):
    if len(str(i)) % 2 == 1:
        count += 1
print(count)

def resolve():
    N = int(input())
    ans = 0
    for i in range(1, N + 1):
        s = str(i)
        if len(s) % 2 == 0:
            continue
        ans += 1
    return print(ans)


if __name__ == "__main__":
    resolve()

-N = int(eval(input())) -count = 0 -for i in range(1, N + 1): -    if len(str(i)) % 2 == 1: -        count += 1 -print(count) +def resolve(): +    N = int(input()) +    ans = 0 +    for i in range(1, N + 1): +        s = str(i) +        if len(s) % 2 == 0: +            continue +        ans += 1 +    return print(ans) + + +if __name__ == "__main__": +    resolve()