#include <bits/stdc++.h>
using namespace std;
int main() {
  int k, m, s, q, ct;
  string n;
  cin >> k;
  cin >> n;
  m = n.size();
  vector<int> a(10);
  s = 0;
  for (int i = 0; i < m; i++) {
    a[n[i] - '0']++;
    s += n[i] - '0';
  }
  q = k - s;
  if (q <= 0) {
    cout << 0;
    return 0;
  }
  ct = 0;
  for (int i = 0; i < 9; i++) {
    if (a[i] * (9 - i) >= q) {
      ct += (q / (9 - i));
      if (q % (9 - i) != 0) {
        ct++;
      }
      cout << ct;
      return 0;
    } else {
      q -= a[i] * (9 - i);
      ct += a[i];
    }
  }
  return 0;
}
