#include <bits/stdc++.h>
using namespace std;
int toI(char ch) { return ch - '0'; }
const int MAX = 2000000000;
int main() {
  int k;
  cin >> k;
  vector<int> count(10);
  string n;
  cin >> n;
  int all_sum = 0;
  for (unsigned i = 0; i < n.size(); ++i) {
    ++count[toI(n[i])];
    all_sum += toI(n[i]);
  }
  int c = 0;
  int st = 0;
  while (st < 9 && k > all_sum) {
    c += min((k - all_sum + 8 - st) / (9 - st), count[st]);
    all_sum += count[st] * (9 - st);
    ++st;
  }
  cout << c;
  return 0;
}
