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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {

    
    /**
     * 
     * Farmer John has three milking buckets of capacity A, B, and C liters. Each of the numbers A, B, and C is an integer from 1 through 20, inclusive. 
     * Initially, buckets A and B are empty while bucket C is full of milk. Sometimes, FJ pours milk from one bucket to another until the second bucket is filled or the first bucket is empty. 
     * Once begun, a pour must be completed, of course. Being thrifty, no milk may be tossed out.

Write a program to help FJ determine what amounts of milk he can leave in bucket C when he begins with three buckets as above, pours milk among the buckets for a while, 
and then notes that bucket A is empty.

PROGRAM NAME: milk3

INPUT FORMAT

A single line with the three integers A, B, and C.

SAMPLE INPUT (file milk3.in)

8 9 10
OUTPUT FORMAT

A single line with a sorted list of all the possible amounts of milk that can be in bucket C when bucket A is empty.

SAMPLE OUTPUT (file milk3.out)

1 2 8 9 10
SAMPLE INPUT (file milk3.in)

2 5 10
SAMPLE OUTPUT (file milk3.out)

5 6 7 8 9 10
     */
    
    /**
     * 
     * 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.
     */
	
  static BufferedReader in;
  static PrintWriter out;
  static StringTokenizer tok;
  
  public static int nextInt() throws IOException {
	    return Integer.parseInt(next());
  }
  

  
  public static int[] readIntArray(int size) throws IOException {
      int[] result = new int[(int) size];
      for (int i = 0; i < size; i++) {
          result[(int) i] = (int)nextInt();
      }
      return result;
  }

  static void solve() throws Exception {
	  	
	  	int k = nextInt();
	  	String n = nextLine();
	  	
        char c[] = n.toCharArray();
	  	int digits = 0;
	  	long total = 0;
	  	
	  	for (int i = 0; i < n.length(); i++) {
	  	  total += Character.getNumericValue(n.charAt(i));
	  	}

	  	int result = 0;
	  	int index = 0;
	  	Arrays.sort(c);
	  	while(total < k) {
	  	    total = total - (long)(c[index] - '0');
	  	    total +=9;
	  	    result++;
	  	    index++;
	  	}
	  	
	  	System.out.println(result);
	  	
  }
  
  public static boolean isPalindrome(int[] num){
	    for(int i = 0 ; i < num.length/2 ; i++) {
	        if(num[i]!=num[num.length-(i+1)]) return false;
	    }
	    return true;
	}
  
  static double nextDouble() throws IOException {
	    return Double.parseDouble(next());
  }

  public static void main(String args[]) {
    try {
      in = new BufferedReader(new InputStreamReader(System.in));
      out = new PrintWriter(new OutputStreamWriter(System.out));
      solve();
      in.close();
      out.close();
    } catch (Throwable e) {
      e.printStackTrace();
      System.exit(1);
    }
  }


  static int[] nextIntArray(int len, int start) throws IOException {
    int[] a = new int[len];
    for (int i = start; i < len; i++)
      a[i] = nextInt();
    return a;
  }

  static long nextLong() throws IOException {
    return Long.parseLong(next());
  }

  static long[] nextLongArray(int len, int start) throws IOException {
    long[] a = new long[len];
    for (int i = start; i < len; i++)
      a[i] = nextLong();
    return a;
  }


  static double[] nextDoubleArray(int len, int start) throws IOException {
    double[] a = new double[len];
    for (int i = start; i < len; i++)
      a[i] = nextDouble();
    return a;
  }

  static BigInteger nextBigInteger() throws IOException {
    return new BigInteger(next());
  }

  static String next() throws IOException {
    while (tok == null || !tok.hasMoreTokens()) {
      tok = new StringTokenizer(in.readLine());
    }
    return tok.nextToken();
  }

  static String nextLine() throws IOException {
    tok = new StringTokenizer("");
    return in.readLine();
  }

  static void shuffleArray(long[] array) {
    Random random = new Random();
    for (int i = array.length - 1; i > 0; i--) {
      int index = random.nextInt(i + 1);
      long temp = array[index];
      array[index] = array[i];
      array[i] = temp;
    }
  }

  static boolean hasNext() throws IOException {
    while (tok == null || !tok.hasMoreTokens()) {
      String s = in.readLine();
      if (s == null) {
        return false;
      }
      tok = new StringTokenizer(s);
    }
    return true;
  }
  

}