Let's denote a function $f(x)$ in such a way: we add $1$ to $x$, then, while there is at least one trailing zero in the resulting number, we remove that zero. For example,   $f(599) = 6$: $599 + 1 = 600 \rightarrow 60 \rightarrow 6$;  $f(7) = 8$: $7 + 1 = 8$;  $f(9) = 1$: $9 + 1 = 10 \rightarrow 1$;  $f(10099) = 101$: $10099 + 1 = 10100 \rightarrow 1010 \rightarrow 101$. 

We say that some number $y$ is reachable from $x$ if we can apply function $f$ to $x$ some (possibly zero) times so that we get $y$ as a result. For example, $102$ is reachable from $10098$ because $f(f(f(10098))) = f(f(10099)) = f(101) = 102$; and any number is reachable from itself.

You are given a number $n$; your task is to count how many different numbers are reachable from $n$.


-----Input-----

The first line contains one integer $n$ ($1 \le n \le 10^9$).


-----Output-----

Print one integer: the number of different numbers that are reachable from $n$.


-----Examples-----
Input
1098

Output
20

Input
10

Output
19



-----Note-----

The numbers that are reachable from $1098$ are:

$1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1098, 1099$.

Difficulty: introductory

Starter code:

Solutions:
darling = {}
x = int(input())
ans = 0
while (x not in darling):
	darling[x] = 1
	ans += 1
	x += 1
	while (x % 10 == 0):
		x /= 10

print(ans)

x = int(input())
def f(x):
    x += 1
    while x % 10 == 0:
        x //= 10
    return x
d = set()
while not x in d:
    d.add(x)
    x = f(x)
print(len(d))

def main():
    s = set()
    n = int(input())
    def f(x):
        x += 1
        while not x % 10:
            x //= 10
        return x
    while n not in s:
        s.add(n)
        n = f(n)
    print(len(s))
    return 0

main()

# AC
import sys


class Main:
    def __init__(self):
        self.buff = None
        self.index = 0

    def __next__(self):
        if self.buff is None or self.index == len(self.buff):
            self.buff = self.next_line()
            self.index = 0
        val = self.buff[self.index]
        self.index += 1
        return val

    def next_line(self, _map=str):
        return list(map(_map, sys.stdin.readline().split()))

    def next_int(self):
        return int(next(self))

    def solve(self):
        n = self.next_int()
        rs = {}
        while n not in rs:
            rs[n] = n
            n += 1
            while n % 10 == 0:
                n /= 10
        print(len(rs))

def __starting_point():
    Main().solve()

__starting_point()

x = int(input())

seen = set()

def f(x):
	x += 1
	while x % 10 == 0:
		x  = x // 10
	return x


while x not in seen:
	seen.add(x)
	x = f(x)

print(len(seen))

from collections import defaultdict
n = int(input())
d = defaultdict(int)
c = 1
d[n] = 1
while True:
    n = n+1
    while n%10==0:
        n= n/10
    
    if d[n]==1:
        break
    else:
        d[n]=1
        c+=1

print(c)

n = int(input())
s = set()
x = n
s.add(x)
ans = 0
while 1:
    x = x + 1
    while x % 10 == 0:
        x //= 10

    if x in s:
        break
    else:
        s.add(x)
        ans += 1
print(len(s))


n = int(input())
num = 9
while len(str(n)) != 1:
    num += 1
    n += 1
    while n % 10 == 0:
        n //= 10
    
print(num)


n = int(input())
doneNums = []
while n not in doneNums:
    doneNums.append(n)
    n += 1
    while n % 10 == 0:
        n/=10
print(len(doneNums))

import sys

input = sys.stdin.readline

n = int(input())

visited = set()

def f(n):
  n = n+1
  while (n % 10 == 0):
    n /= 10
  return n

ans = 0

while f(n) not in visited:
  visited.add(n)
  n = f(n)
  ans += 1

print(ans+1)


def f(x):
    x+=1
    while(x%10==0 and x>0):
        x//=10
    return x
vals=set()
n=int(input())
vals.add(n)
while f(n) not in vals:
    vals.add(f(n))
    n=f(n)
print(len(vals))

a=input()
alle = set()
alle.add(int(a))

while True:
	x = int(a)
	x += 1
	y = str(x)
	while y[-1] == "0":
		y = y[:-1]
	if int(y) in alle:
		break
	alle.add(int(y))
	a = y
print(len(alle))


n=int(input())
dict1={}
flag=0
dict1[n]=1
while(flag==0):
	n+=1
	while(n%10==0):
		n=n//10
	try:
		dict1[n]+=1
		flag=1
	except:
		KeyError
		dict1[n]=1
print(len(dict1))

n = int(input())
t = 0
while n > 9:
    n += 1
    while n % 10 == 0:
        n //= 10
    t += 1
print(t + 9)


def f(n):
    n+=1
    while n%10==0:
        n/=10
    return n

x = int(input())
l = [x]
while 1:
    x = f(x)
    if x in l:
        break
    l.append(x)
print(len(l))

n = int(input())

seen = set()

while n not in seen:
	seen.add(n)
	n += 1
	while n%10 == 0:
		n //= 10

print(len(seen))

import sys
sys.setrecursionlimit(2000)
from collections import Counter
from functools import reduce
# sys.stdin.readline()

def __starting_point():

    # single variables
    n = [int(val) for val in sys.stdin.readline().split()][0]

    count = 0
    s = set([])
    while(not n in s):
        s.add(n)
        n += 1
        n = str(n)
        while(n[-1] == '0'):
            n = n[:-1]
        n = int(n)
        count += 1
    print(count)



__starting_point()

n = int(input())
a = 0
while n >= 10:
   n += 1
   a += 1
   while n % 10 == 0:
      n = n // 10

print(a + 9)
   


# -*- coding: utf-8 -*-
"""
@Project : CodeForces
@File    : 1.py 
@Time    : 2019/4/26 22:31
@Author  : Koushiro 
"""
def find(num):
    num+=1
    while num%10==0:
        num=num//10
    return num

def __starting_point():
    n= int(input())
    dic={n:1}
    n=find(n)
    while n not in dic:
        dic[n]=1
        n=find(n)
    print(len(dic))
__starting_point()

n=int(input())
s=set()
s.add(n)
while(n!=1):
	n=n+1
	while((n%10)==0):
		n=n//10
	s.add(n)
for i in range(2,10):
	s.add(i)
print(len(s))


def f(x):
    return int(str(x + 1).rstrip('0'))

def main():
    x = int(input())

    l = set()

    while x not in l:
        l.add(x)
        x = f(x)
    
    print(len(l))
        

def __starting_point():
    main()
__starting_point()

f = lambda x: str(n + 1).rstrip('0')
n = int(input())
s = set()
while n not in s:
    s.add(n)
    n = int(f(n))
print(len(s))

n = int(input())

st = {}

while not n in st:
	st[n] = True
	n += 1
	while n%10 == 0:
		n /= 10

print(len(st))


def f(x):
    x += 1
    while not x % 10:
        x //= 10
    return x


previous = set()

n = int(input())
while n not in previous:
    previous.add(n)
    n = f(n)

print(len(previous))


#!/usr/bin/env python3
# -*- coding: utf-8 -*-
##################################
# University of Wisconsin-Madison
# Author: Yaqi Zhang
##################################
# This module contains
##################################

# standard library
import sys

def main():
    # nums = list(map(int, input().split()))
    num = int(input())
    seen = set()
    while num:
        if num in seen:
            break
        seen.add(num)
        num += 1
        while num % 10 == 0:
            num //= 10
    print(len(seen))

def __starting_point():
    main()


__starting_point()