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.lang.*;
import java.io.*;
import java.util.*;
import java.math.*;

public class Main implements Runnable{
	public static void main(String args[] ) throws Exception {
		new Thread(null, new Main(),"Main",1<<27).start();
	}
	
	public static int f(int n) {
		n++;
		while(n%10==0) {
			n/=10;
		}
		return n;
	}
	
	//---------------------------------Actual CODE---------------------------------------//
	public void run() {
		InputReader in = new InputReader(System.in);
	    PrintWriter out = new PrintWriter(System.out); 
//	    int t = in.nextInt();
//	    while(t-- > 0)
	    {
	    	int n=in.nextInt(), ans=0;
			Set<Integer> a=new HashSet();
			while(!a.contains(n)) {
				a.add(n);
				n=f(n);
			}
			out.println(a.size());
	    }
	    out.close();
	}
	//----------------------------------------------------------------------------------//
	public static int subarraysum(int a[], int n) {
		int maxcurr=a[0], max=a[0];
		for(int i=1;i<n;i++) {
			maxcurr=Math.max(a[i], a[i]+maxcurr);
			max=Math.max(maxcurr, max);
		}
		return max;
	}
	public static void mergeSort(int a[], int l, int h) {
		if(l<h) {
			int mid=(l+h)/2;	
			mergeSort(a, l, mid);
			mergeSort(a, mid+1, h);
			merge(a, l, mid, h);
		}
	}
	public static void merge(int a[], int l, int mid, int h) {
		int m1[]=Arrays.copyOfRange(a, l, mid+1 );
		int m2[]=Arrays.copyOfRange(a, mid+1, h+1);
		int i=0,j=0,k=l;
		while(i<m1.length && j<m2.length) {
			if(m1[i]<=m2[j])
				a[k++]=m1[i++];
			else
				a[k++]=m2[j++];
		}
		while(i<m1.length)
			a[k++]=m1[i++];
		while(j<m2.length)
			a[k++]=m2[j++];
	}
	public static void quickSort(int a[], int l, int h) {
		if(l<h) {
			int pivotindx=partition(a,l,h);
			quickSort(a, l, pivotindx-1);
			quickSort(a, pivotindx+1, h);
		}
	}
	public static int partition(int a[], int l, int h) {
		int pivot=a[h], p_inx=l, temp=0;
		for(int i=l;i<h;i++) {
			if(a[i]<=pivot) {
				temp=a[i];
				a[i]=a[p_inx];
				a[p_inx]=temp;
				p_inx++;
			}
		}
		temp=a[h];
		a[h]=a[p_inx];
		a[p_inx]=temp;
		return p_inx;
	}
	public static int binarySearch(int a[], int l, int h, int x) {
		while(l<=h) {
			int mid=l+(h-l)/2;
			if(a[mid]==x)
				return mid;
			else if(a[mid]<x)
				l=mid+1;
			else
				h=mid-1;
		}
		return -1;
	}
	public static int gcd(int a, int b) {
		if(b==0)
			return a;
		else
			return gcd(b,a%b);
	}
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        public InputReader(InputStream stream) {
            this.stream = stream;
        }
       
        public int read() {
            if (numChars==-1)
                throw new InputMismatchException();
           
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                }
                catch (IOException e) {
                    throw new InputMismatchException();
                }
            
                if(numChars <= 0)              
                    return -1;
            }
            return buf[curChar++];
        }
     
        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        public int nextInt() {
            int c = read();
           
            while(isSpaceChar(c))
                c = read();
           
            int sgn = 1;
           
            if (c == '-') {
                sgn = -1;
                c = read();
            }
           
            int res = 0;
            do {
                if(c<'0'||c>'9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
           
            return res * sgn;
        }
       
        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
           
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
                return res * sgn;
        }
       
        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1; 
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
       
        public String readString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();	
            do {
                res.appendCodePoint(c);
                c = read();
            }
            while (!isSpaceChar(c));
           
            return res.toString();
        }
     
        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
     
        public String next() {
            return readString();
        }
       
        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}
