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.
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.HashSet;

public class A {

	static HashSet<Integer> set = new HashSet<Integer>();
	public static void main(String[] args) {
		JS in = new JS();
		int x = in.nextInt();
		go(x);
		System.out.println(set.size());
	}
	
	static void go(int x) {
		if(set.contains(x)) return;
		set.add(x);
		
		int y = x+1;
		String s = String.valueOf(y);
		int endId = s.length();
		for(int i = endId-1; i >= 0; i--) {
			if(s.charAt(i) != '0') {
				endId = i+1;
				break;
			}
		}
		
		int next = Integer.valueOf(s.substring(0,endId));
		go(next);
	}
	
	

static class JS{
	public int BS = 1<<16;
	public char NC = (char)0;
	byte[] buf = new byte[BS];
	int bId = 0, size = 0;
	char c = NC;
	double num = 1;
	BufferedInputStream in;

	public JS() {
		in = new BufferedInputStream(System.in, BS);
	}

	public JS(String s) throws FileNotFoundException {
		in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
	}

	public char nextChar(){
		while(bId==size) {
			try {
				size = in.read(buf);
			}catch(Exception e) {
				return NC;
			}				
			if(size==-1)return NC;
			bId=0;
		}
		return (char)buf[bId++];
	}

	public int nextInt() {
		return (int)nextLong();
	}

	public long nextLong() {
		num=1;
		boolean neg = false;
		if(c==NC)c=nextChar();
		for(;(c<'0' || c>'9'); c = nextChar()) {
			if(c=='-')neg=true;
		}
		long res = 0;
		for(; c>='0' && c <='9'; c=nextChar()) {
			res = (res<<3)+(res<<1)+c-'0';
			num*=10;
		}
		return neg?-res:res;
	}

	public double nextDouble() {
	    while(c!='.'&&c!='-'&&(c <'0' || c>'9')) c = nextChar();
	    boolean neg = c=='-';
	    if(neg)c=nextChar();
	    boolean fl = c=='.';
	    double cur = nextLong();
	    if(fl) return neg ? -cur/num : cur/num;
	    if(c == '.') {
		double next = nextLong();
		return neg ? -cur-next/num : cur+next/num;
	    }
	    else return neg ? -cur : cur;
	}

	public String next() {
		StringBuilder res = new StringBuilder();
		while(c<=32)c=nextChar();
		while(c>32) {
			res.append(c);
			c=nextChar();
		}
		return res.toString();
	}

	public String nextLine() {
		StringBuilder res = new StringBuilder();
		while(c<=32)c=nextChar();
		while(c!='\n') {
			res.append(c);
			c=nextChar();
		}
		return res.toString();
	}

	public boolean hasNext() {
		if(c>32)return true;
		while(true) {
			c=nextChar();
			if(c==NC)return false;
			else if(c>32)return true;
		}
	}
}

}
