# ABC136b

import sys

input = sys.stdin.readline

sys.setrecursionlimit(10**6)



n = int(eval(input()))



c = 0

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

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

        c += 1

print(c)
def main():

    import sys

    input = sys.stdin.readline

    sys.setrecursionlimit(10**6)

    # map(int, input().split())

    n = int(eval(input()))

    ans = 0

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

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

            ans += 1



    print(ans)





if __name__ == '__main__':

    main()

# ABC136b
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10**6)
n = int(eval(input()))
c = 0
for i in range(1, n + 1):
    if len(str(i)) % 2 == 1:
        c += 1
print(c)

def main():
    import sys

    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    # map(int, input().split())
    n = int(eval(input()))
    ans = 0
    for i in range(1, n + 1):
        if len(str(i)) % 2 == 1:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

-# ABC136b -import sys +def main(): +    import sys -input = sys.stdin.readline -sys.setrecursionlimit(10**6) -n = int(eval(input())) -c = 0 -for i in range(1, n + 1): -    if len(str(i)) % 2 == 1: -        c += 1 -print(c) +    input = sys.stdin.readline +    sys.setrecursionlimit(10**6) +    # map(int, input().split()) +    n = int(eval(input())) +    ans = 0 +    for i in range(1, n + 1): +        if len(str(i)) % 2 == 1: +            ans += 1 +    print(ans) + + +if __name__ == "__main__": +    main()