<filename>ABC_B/ABC136_B.py
n = input()

if len(n) == 1:
    print(n)
elif len(n) == 2:
    print(9)
elif len(n) == 3:
    print(int(n)+10-100)
elif len(n) == 4:
    print(909)
elif len(n) == 5:
    print(int(n)+910-10000)
elif len(n) == 6:
    print(90909)

<filename>ABC_B/ABC136_B.py
n = input()

if len(n) == 1:
    print(n)
elif len(n) == 2:
    print(9)
elif len(n) == 3:
    print(int(n)+10-100)
elif len(n) == 4:
    print(909)
elif len(n) == 5:
    print(int(n)+910-10000)
elif len(n) == 6:
    print(90909)
