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.io.*;
import java.math.*;
public class CF835B {
public static void main(String args[]) {

	String name = "input";
	String path = "/media/remedy441/Study/Codes/Java/InputOutput/";
	Locale.setDefault(Locale.US);
	//FileInputStream fileIn = new FileInputStream(path + name + ".in");
	//File fileOut = new File(path + name + ".out");

	//InputReader in = new InputReader(fileIn);
	//PrintWriter out = new PrintWriter(path + name + ".out");

	InputReader in = new InputReader(System.in);
	PrintWriter out = new PrintWriter(System.out);

	//My Code Starts Here
	int k = in.nextInt();
	String s = in.nextLine();
	char ar[]=s.toCharArray();
	
	int ans =0;
	int ss =0;
	int l = s.length();
	for(int i =0;i<l;i++){
		ss = ss + ar[i]-'0';
	}
	Arrays.sort(ar);
	
	int x = k;
	int i=0;
	int c=0;
	while(i<l&&ss<k){
		//out.println('9'-ar[i]+" "+ss);
		if(('9'-ar[i])<=(k-ss)){
			c++;
			ss=ss + ('9'-ar[i]);
		}
		else{
			//out.print("yes");
			c++;
			ss = k;
		}
		i++;
		//out.println(c+" "+ss+" "+k);
	}
	
	out.println(c);
	//EndsHere

	out.close();

}

int sieveOfEratosthenes(int n) {
	// Create a boolean array "prime[0..n]" and initialize
	// all entries it as true. A value in prime[i] will
	// finally be false if i is Not a prime, else true.
	boolean prime[] = new boolean[n + 1];
	for (int i = 0; i <= n; i++)
		prime[i] = true;

	for (int p = 2; p * p <= n; p++) {
		// If prime[p] is not changed, then it is a prime
		if (prime[p] == true) {
			// Update all multiples of p
			for (int i = p * 2; i <= n; i += p)
				prime[i] = false;
		}
	}
	int c = 0;
	for (int i = 2; i <= n; i++) {
		if (prime[i] == true)
			c++;
	}
	return c;
	// Print all prime numbers
	/* for(int i = 2; i <= n; i++)
	 {
	     if(prime[i] == true)
	         System.out.print(i + " ");
	 }*/
}

static class Pair implements Comparable<Pair> {
	int u;
	int v;
	BigInteger bi;

	public Pair(int u, int v) {
		this.u = u;
		this.v = v;
	}

	public int hashCode() {
		int hu = (int) (u ^ (u >>> 32));
		int hv = (int) (v ^ (v >>> 32));
		return 31 * hu + hv;
	}

	public boolean equals(Object o) {
		Pair other = (Pair) o;
		return u == other.u && v == other.v;
	}

	public int compareTo(Pair other) {
		return Long.compare(u, other.u) != 0 ? Long.compare(u, other.u) : Long.compare(v, other.v);
	}

	public String toString() {
		return "[u=" + u + ", v=" + v + "]";
	}
}

static long modulo(long a, long b, long c) {
	long x = 1;
	long y = a;
	while (b > 0) {
		if (b % 2 == 1) {
			x = (x * y) % c;
		}
		y = (y * y) % c; // squaring the base
		b /= 2;
	}
	return x % c;
}

long factorial(long n, long M) {
	long ans = 1;
	while (n >= 1) {
		ans = (ans * n) % M;
		n--;
	}
	return ans;
}

static long gcd(long x, long y) {
	if (x == 0)
		return y;
	if (y == 0)
		return x;
	long r = 0, a, b;
	a = (x > y) ? x : y; // a is greater number
	b = (x < y) ? x : y; // b is smaller number
	r = b;
	while (a % b != 0) {
		r = a % b;
		a = b;
		b = r;
	}
	return r;
}

static class InputReader {
	public BufferedReader reader;
	public StringTokenizer tokenizer;

	public InputReader(InputStream inputstream) {
		reader = new BufferedReader(new InputStreamReader(inputstream));
		tokenizer = null;
	}

	public String nextLine() {
		String fullLine = null;
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				fullLine = reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
			return fullLine;
		}
		return fullLine;
	}

	public String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}
}
}
