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 javax.print.attribute.standard.MediaPrintableArea;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.io.*;
import java.util.*;
/**
 * Created by Firеfly on 1/1/2017.
 */
public class Task {
    public static void main(String[] args) throws IOException {
        Emaxx emaxx = new Emaxx();
    }
}


class Emaxx {
    FScanner fs;
    PrintWriter pw;
    int n, off, m, k;
    Integer W;
    ArrayList<Integer>[] graph;
    int[][] to;
    double[] comes, zh;
    int[] nums, res;
    LinkedList<Pair> qoue;
    boolean[] flags;
    Emaxx() throws IOException {
        fs = new FScanner(new InputStreamReader(System.in));
        // pw = new PrintWriter(new FileWriter("arithnumbers.out"));
        //  fs = new FScanner(new FileReader("C:\\Users\\Firеfly\\Desktop\\New Text Document.txt"));
        //     fs = new FScanner(new FileReader("input.txt"));;
        //       pw = new PrintWriter("output.txt");
        PrintWriter pw = new PrintWriter(System.out);
        int k = fs.nextInt();
        char[] num = fs.nextLine().toCharArray();
        int cur = 0;
        for (int i = 0; i<num.length; i++)
            cur+=num[i]-'0';
        if (cur>=k)
            pw.println(0);
        else {
            int dif = k-cur;
            int[] mas = new int[num.length-1];
            int counter = 0;
            for (int i = 1; i<num.length; i++)
                mas[i-1] = num[i]-'0';
            Arrays.sort(mas);
            int g = 0;
            while (g<mas.length && mas[g] < num[0]-'0') {
                counter++;
                dif -=9-mas[g++];
                if (dif<=0)
                {
                    System.out.println(counter);
                    System.exit(0);
                }
            }
            dif -=9-(num[0]-'0');
            counter++;
            if (dif<=0)
            {
                System.out.println(counter);
                System.exit(0);
            }
            while (g<mas.length) {
                counter++;
                dif -=9-mas[g++];
                if (dif<=0)
                {
                    System.out.println(counter);
                    System.exit(0);
                }
            }

        }
        pw.close();
    }
    int gcd (int a, int b) {
        if (b == 0)
            return a;
        else
            return gcd (b, a % b);
    }



}


class Triple implements Comparable<Triple> {
    int t, ni, k;
    Triple(int x1, int y1, int c1) {
        t = x1; ni = y1; k = c1;
    }

    @Override
    public int compareTo(Triple triple) {
        return Integer.compare(t, triple.t);
    }
}
class Pair implements Comparable<Pair>{
    int x, y;
    Pair(int x1, int y1) {x = x1; y = y1;}
    Pair(){}
    @Override
    public int compareTo(Pair o) {
        return Integer.compare(x, o.x);
    }
}

class Algs {
    public static int[] Z_f(char[] s) {
        int[] zf = new int[s.length];
        zf[0] = -1;
        int l = 0, r= 0;
        for (int i = 1; i<s.length; i++) {
            if (i>r)
            {
                int g = i;
                while (g < s.length && s[g] == s[g-i])
                    g++;
                if (g == i)
                    continue;
                l = i;
                r = g-1;
                zf[i] = g-i;
            } else {
                if (zf[i-l]<=r-i+1)
                    zf[i] = zf[i-l];
                else {
                    int g = r+1;
                    while (g <s.length && s[g] == s[g-i])
                        g++;
                    if (g == r+1)
                        zf[i] = r-i+1;
                    else {
                        zf[i] = g-i;
                        r = g-1;
                        l = i;
                    }
                }
            }
        }
        return zf;
    }
}



class FScanner {
    BufferedReader br;
    StringTokenizer st;
    FScanner(InputStreamReader isr) {
        br = new BufferedReader(isr);
    }

    FScanner(FileReader fr) {
        br = new BufferedReader(fr);
    }

    String nextToken() throws IOException{
        while (st == null || !st.hasMoreTokens()) {
            String s = br.readLine();
            if (s == null)
                return null;
            st = new StringTokenizer(s);
        }
        return st.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

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

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextLine() throws IOException {
        return br.readLine();
    }

    char nextChar() throws IOException {
        return (char) br.read();
    }
}
