s = eval(input())

n = int(s)

m = len(s)

ans = 0

i = 1

while(True):

    if i == m:

        ans += n - 10 ** (i - 1) + 1

        break

    elif i > m:

        break

    ans += 10 ** i - 10 ** (i - 1)

    i += 2

print(ans)

s = eval(input())

n = int(s)

m = len(s)

ans = 0

i = 1

while(True):

    if i == m:

        ans += n - 10 ** (i - 1) + 1

        break

    elif i > m:

        break

    ans += 9 * 10 ** (i - 1)

    i += 2

print(ans)

s = eval(input())
n = int(s)
m = len(s)
ans = 0
i = 1
while True:
    if i == m:
        ans += n - 10 ** (i - 1) + 1
        break
    elif i > m:
        break
    ans += 10**i - 10 ** (i - 1)
    i += 2
print(ans)

s = eval(input())
n = int(s)
m = len(s)
ans = 0
i = 1
while True:
    if i == m:
        ans += n - 10 ** (i - 1) + 1
        break
    elif i > m:
        break
    ans += 9 * 10 ** (i - 1)
    i += 2
print(ans)

-    ans += 10**i - 10 ** (i - 1) +    ans += 9 * 10 ** (i - 1)