#include <bits/stdc++.h>
using namespace std;
long long a[10] = {0};
int main() {
  long long k;
  string s;
  cin >> k >> s;
  long long sum = 0;
  for (int i = 0; i < s.size(); i++) {
    a[s[i] - '0']++;
  }
  for (int i = 0; i < 10; i++) sum += a[i] * i;
  int cnt = 0;
  k -= sum;
  if (k > 0) {
    for (int i = 0; i < 9; i++) {
      if (a[i]) {
        if (k > a[i] * (9 - i)) {
          k -= a[i] * (9 - i);
          cnt += a[i];
        } else {
          cnt += k / (9 - i);
          if (k % (9 - i) != 0) cnt++;
          k = 0;
        }
      }
      if (k <= 0) break;
    }
  }
  cout << cnt << endl;
  return 0;
}
