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 → 60 → 6; 
  * f(7) = 8: 7 + 1 = 8; 
  * f(9) = 1: 9 + 1 = 10 → 1; 
  * f(10099) = 101: 10099 + 1 = 10100 → 1010 → 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 ≤ n ≤ 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.
# stdin=open('input.txt')

# def input():
# 	return stdin.readline()[:-1]

# stdout=open('output.txt',mode='w+')

# def print(x, end='\n'):
# 	stdout.write(str(x) +end)

# a, b = map(int, input().split())

# l = list(map(int, input().split()))


# CODE BEGINS HERE.................

# compare(i, j)
# 	global a
# 	global b
# 	global m
# 	global bits

# 	x = bits[j]
# 	z = bits[i]
# 	m = (a[j]*x - a[i]*z + b[j] - b[i])/(a[i] + a[j])
# 	if m > 0:
# 		if m < m[i]:
# 			y1 = m
# 		else:
# 			y1 = m[i]
# 	else:
# 		y1 = 0
# 	if x < m[i] and x < (b[j] - b[i] - a[i]*z)/(a[i] - a[j]):
# 		y2 = x
# 	else:
# 		y2 = 0
# 	if y1 == 0:
# 		if y2 == 0:
# 			y = 0
# 		else:
# 			y = y2
# 	else:
# 		if y2 == 0:
# 			y = y1
# 		else:
# 			t1 = a[j]*(x - y1) + b[j]
# 			t2 = a[i]*x + b[i]

# 			if t1 < t2:
# 				y = t1
# 			else:
# 				y = t2
# 	bits[j] -= y
# 	bits[i] += y
# 	return y

# for t in range(int(input())):
# 	print('Case #' + str(t + 1) + ': ', end = '')
# 	n, p = map(int, input().split())

# 	w = []
# 	h = []

# 	for i in range(n):
# 		wi, hi = map(int, input().split())
# 		w.append(wi)
# 		h.append(hi)

# 	curr = n*2*(w[0] + h[0])

# 	increase = p - curr
# 	minDeltaInc = 2*min(w[0], h[0])
# 	maxDeltaInc = 2*(w[0]**2 + h[0]**2)**(1/2)

# 	cuts = min((increase//minDeltaInc), n)
# 	scope = cuts*(maxDeltaInc - minDeltaInc)
# 	left = increase - cuts*(minDeltaInc)

# 	# print(cuts, scope, left)
# 	if scope < left:
# 		print(p - (left - scope))
# 	else:
# 		print(p)


n = int(input())
count = 0
while True:
	# print(n, end = ' ')
	count += 10 - n%10
	# print(count)
	if n//10 == 0:
		count += n%10 - 1
		break
	n += 10 - n%10
	while(n%10 == 0):
		n//= 10
print(count)

#CODE ENDS HERE....................
# stdout.close()


