#!/usr/bin/env python



def main(N):

    ans = 0

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

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

            ans += 1

    return(ans)

    

if __name__ == '__main__':

    N = int(eval(input())) 

    print((main(N)))

#!/usr/bin/env python

def main():

    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()



#!/usr/bin/env python
def main(N):
    ans = 0
    for i in range(1, N + 1):
        if len(str(i)) % 2 == 1:
            ans += 1
    return ans


if __name__ == "__main__":
    N = int(eval(input()))
    print((main(N)))

#!/usr/bin/env python
def main():
    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()

-def main(N): +def main(): +    N = int(eval(input())) -    return ans +    print(ans) -    N = int(eval(input())) -    print((main(N))) +    main()