Some natural number was written on the board. Its sum of digits was not less than k. But you were distracted a bit, and someone changed this number to n, replacing some digits with others. It's known that the length of the number didn't change.

You have to find the minimum number of digits in which these two numbers can differ.

Input

The first line contains integer k (1 ≤ k ≤ 109).

The second line contains integer n (1 ≤ n < 10100000).

There are no leading zeros in n. It's guaranteed that this situation is possible.

Output

Print the minimum number of digits in which the initial number and n can differ.

Examples

Input

3
11


Output

1


Input

3
99


Output

0

Note

In the first example, the initial number could be 12.

In the second example the sum of the digits of n is not less than k. The initial number could be equal to n.
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    
    //StringTokenizer st=new StringTokenizer(br.readLine());
    //ArrayList<Integer> list = new ArrayList<Integer>();
    //int n=scan.scanInt();
    //Long n=Long.parseLong(st.nextToken());
    //long n=Long.parseLong(br.readLine());
    //int n=Integer.parseInt(br.readLine());
    //int n=scan.scanInt();
    //System.out.println();
    /*int t=Integer.parseInt(br.readLine());
        for(;t!=0;t--){
            
        }*/
    
	public static void main (String[] args) throws java.lang.Exception
	{
	    Scan scan=new Scan();
		Print print=new Print();
		int k=scan.scanInt();
		String s=scan.scanString();
		int sum=0;
		int i;
		for(i=0;i<s.length();i++)
		{
		    sum+=s.charAt(i)-'0';
		}
		if(sum>=k)
		System.out.println(0);
		else
		{
		    int arr[]  =new int[10];
		    for(i=0;i<s.length();i++)
    		{
    		    arr[s.charAt(i)-'0']++;
    		}
    		
    		int ans=0;
    		int diff=k-sum;
    		
    		for(i=0;i<10;i++)
    		{
    		    
    		    int has=arr[i];int val=9-i;
    		    int m=has*val;
    		    if(m>=diff)
    		    {
    		        int x=(int)Math.ceil(diff*1.0/val);
    		        ans+=x;
    		        break;
    		    }
    		    else
    		    {
    		        diff-=(m);
    		        ans+=has;
    		    }
    		}
    		System.out.println(ans);
		}
	}
}
class Scan
{
	private byte[] buf=new byte[1024];
	private int index;
	private InputStream in;
	private int total;
	public Scan()
	{
		in=System.in;
	}
	public int scan()throws IOException
	{
		if(total<0)
		throw new InputMismatchException();
		if(index>=total)
		{
			index=0;
			total=in.read(buf);
			if(total<=0)
			return -1;
		}
		return buf[index++];
	}
	public int scanInt()throws IOException
	{
		int integer=0;
		int n=scan();
		while(isWhiteSpace(n))
		n=scan();
		int neg=1;
		if(n=='-')
		{
			neg=-1;
			n=scan();
		}
		while(!isWhiteSpace(n))
		{
			if(n>='0'&&n<='9')
			{
				integer*=10;
				integer+=n-'0';
				n=scan();
			}
			else throw new InputMismatchException();
		}
		return neg*integer;
	}
	public double scanDouble()throws IOException
	{
		double doub=0;
		int n=scan();
		while(isWhiteSpace(n))
		n=scan();
		int neg=1;
		if(n=='-')
		{
			neg=-1;
			n=scan();
		}
		while(!isWhiteSpace(n)&&n!='.')
		{
			if(n>='0'&&n<='9')
			{
				doub*=10;
				doub+=n-'0';
				n=scan();
			}
			else throw new InputMismatchException();
		}
		if(n=='.')
		{
			n=scan();
			double temp=1;
			while(!isWhiteSpace(n))
			{
				if(n>='0'&&n<='9')
				{
					temp/=10;
					doub+=(n-'0')*temp;
					n=scan();
				}
				else throw new InputMismatchException();
			}
		}
		return doub*neg;
	}
	public String scanString()throws IOException
	{
		StringBuilder sb=new StringBuilder();
		int n=scan();
		while(isWhiteSpace(n))
		n=scan();
		while(!isWhiteSpace(n))
		{
			sb.append((char)n);
			n=scan();
		}
		return sb.toString();
	}
	private boolean isWhiteSpace(int n)
	{
		if(n==' '||n=='\n'||n=='\r'||n=='\t'||n==-1)
		return true;
		return false;
	}
}
 
class Print
{
	private final OutputStream out;
	/*public Print(OutputStream outputStream)
	{
		writer=new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	}*/
	public Print()
	{
		this.out=System.out;
	}
	public void print(String str)throws IOException
	{
		//buf=str.getBytes();
		for (int i = 0; i < str.length(); i++)
		{
			/*if (i != 0)
			out.write(' ');*/
			out.write(str.charAt(i));
		}
	}
	public void printLine(String str)throws IOException
	{
		print(str);
		out.write('\n');
	}
	public void close()throws IOException
	{
		out.close();
	}
} 
