N = int(eval(input()))



i = 1

cnt = 0



while i <= N:

  cnt += 1

  i += 1

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

    i *= 10

print(cnt)
N = int(eval(input()))



cnt = 0

i = 0

for i in range(0, 5, 2):

  m = 10 ** i

  if len(str(m)) > len(str(N)):

    break

  M = int("9" * (i + 1))

  

  if M > N:

    M = N

  

  cnt += M - m + 1



print(cnt)
N = int(eval(input()))
i = 1
cnt = 0
while i <= N:
    cnt += 1
    i += 1
    if len(str(i)) % 2 == 0:
        i *= 10
print(cnt)

N = int(eval(input()))
cnt = 0
i = 0
for i in range(0, 5, 2):
    m = 10**i
    if len(str(m)) > len(str(N)):
        break
    M = int("9" * (i + 1))
    if M > N:
        M = N
    cnt += M - m + 1
print(cnt)

-i = 1 -while i <= N: -    cnt += 1 -    i += 1 -    if len(str(i)) % 2 == 0: -        i *= 10 +i = 0 +for i in range(0, 5, 2): +    m = 10**i +    if len(str(m)) > len(str(N)): +        break +    M = int("9" * (i + 1)) +    if M > N: +        M = N +    cnt += M - m + 1