#include <bits/stdc++.h>
using namespace std;
int k;
string n;
int s;
int m;
int b;
int main() {
  cin >> k >> n;
  s = n.size();
  for (int i = 0; i < s; i++) {
    m += n[i] - '0';
  }
  m = k - m;
  for (int i = 0; i <= 9; i++) {
    for (int j = 0; j < s; j++) {
      if (m > 0 && n[j] - '0' == i) {
        int d = min(9 - i, m);
        n[j] += d;
        m -= d;
        b++;
      }
    }
  }
  cout << b;
}
