#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  string s;
  cin >> k >> s;
  int occ[10];
  memset(occ, 0, sizeof occ);
  int sum = 0;
  for (auto c : s) {
    sum += (c - '0');
    occ[c - '0']++;
  }
  int diff = k - sum;
  int cont = 0;
  while (diff > 0) {
    int idx = 0;
    for (; idx < 10; idx++)
      if (occ[idx] > 0) break;
    diff -= (9 - idx);
    cont++;
    occ[idx]--;
  }
  printf("%d\n", cont);
  return 0;
}
