Apart from having lots of holidays throughout the year, residents of Berland also have whole lucky years. Year is considered lucky if it has no more than 1 non-zero digit in its number. So years 100, 40000, 5 are lucky and 12, 3001 and 12345 are not.

You are given current year in Berland. Your task is to find how long will residents of Berland wait till the next lucky year.


-----Input-----

The first line contains integer number n (1 ≤ n ≤ 10^9) — current year in Berland.


-----Output-----

Output amount of years from the current year to the next lucky one.


-----Examples-----
Input
4

Output
1

Input
201

Output
99

Input
4000

Output
1000



-----Note-----

In the first example next lucky year is 5. In the second one — 300. In the third — 5000.

Difficulty: interview

Starter code:

Solutions:
def main():
    s = input()
    n = len(s)
    t = int(str(int(s[0]) + 1) + '0' * (n - 1))

    print(t - int(s))

main()


s = input()
x = int(s)
y = int(str(int(s[0]) + 1) + '0' * (len(s) - 1))
print(y - x)

n = int(input())

for i in range(0,11):
    for j in range(1,10):
        m = j*10**i
        if (n<m) :
            print(m-n)
            return




n = int(input())
s = str(n)
s = str(int(s[0]) + 1) + '0' * (len(s) - 1)
s = int(s)
print(s - n)


y = input()
ly = len(y)
iy = int(y)
td = iy/(10**(ly-1))
#print(ly,iy,td)
if(td == 9):
    print(10**ly-iy)
else:
    print((int(y[0])+1)*(10**(ly-1))-iy)

N = input()
print((int(N[0])+1)*(10**(len(N)-1))-int(N))


def solve(n):
    if (n<10):
        return 1
    a = str(n)
    b=int(a[1:])
    return 10**(len(a)-1)-b
    


n = int(input())
print(solve(n))


n = str(int(input())+1)
if n.count("0")+1 == len(n):
    print(1)
else:
    print((int(n[0])+1)*10**(len(n)-1)-int(n)+1)
    


import sys
import math

n = int(input())
s = n
r = 1
while n // 10  != 0:
    n = n // 10
    r *= 10 
next  = (s // r + 1) * r
print(next - s)

n=(input())
cur=int(n[0])
pre=str(cur+1)
next=pre+'0'*(len(n)-1)
print(int(next)-int(n))


n = int(input())
ans = 0
prev = 0
N = n
while n:
	a = n%10
	n //= 10
	ans += 1
	prev = a
if ans==1:
	print(1)
else:
	print(((prev+1)*(10**(ans-1)))-N)


x=input()
n=int(x)
ln=len(x)
y=int(x[0])
y+=1
y=y*(10**(ln-1))
print(y-n)


a=int(input())
b=a
nr=1
while b>9:
    nr*=10
    b/=10
print(int(b+1)*int(nr)-int(a))

t=input()
l=len(t)
print((int(t[0:1])+1)*(10**(l-1))-int(t))



def main():
    n = input()
    d = int(n[0])
    if d < 9:
        year = int(str(d + 1) + '0' * (len(n) - 1))
    else:
        year = int('1' + '0' * len(n))

    print(year - int(n))

def __starting_point():
    main()

__starting_point()

x = int(input())
a = x
x += 1
if len(str(x))-str(x).count('0') <= 1:
    b = x;
else:
    b = int(str(int(str(x)[0])+1)+'0'*(len(str(x))-1))
print(b-a)

# -*- coding: utf-8 -*-

import sys
import os
import math

# input_text_path = __file__.replace('.py', '.txt')
# fd = os.open(input_text_path, os.O_RDONLY)
# os.dup2(fd, sys.stdin.fileno())

n = int(input())

if n < 10:
    print(1)
else:
    s = str(n)
    l = len(s)

    v = 10 ** (l-1)
    w = int(s[1:])

    print(v - w)

n = int(input())
size = len(str(n))
num = str(n)[0]
res = (int(num) + 1) * 10 ** (size - 1) - n
print(res)


def main():
    NUMBERS = [str(i) for i in range(1, 10)]
    num = input()
    result = ''
    if num in NUMBERS:
        result = 1
        return result
    if len(num) == num.count('0') + 1:
        result = int(str(int(num[0]) + 1) + num[1:]) - int(num)
        return result
    result = int(str(int(num[0]) + 1) + (len(num) - 1) * '0') - int(num)
    return result
print(main())

n=input()
i=len(n)-1
t=int(n[0])+1
print(10**i*t-int(n))

n = int(input())
y = 1
d = 0
while y <= n:
    y += 10**d
    if y // 10**(d + 1) == 1:
        d += 1
print(y - n)



import math

n = int(input())

p10 = int(math.log10(n + 1))
p = pow(10, p10)
years = (int(n / p) + 1) * p - n

print(years)


n = input()
y = int(n)

if y < 10:
    print(1)
else:
    l = len(n)
    f = int(n[0]) + 1
    f *= 10 ** (l - 1)
    print(f - y)


n = int(input())
i = 1
cur = n
x = 1
while cur > 0:
    a = cur % 10
    cur //= 10
    x *= 10
print((a+1)*x//10 - n)