#include <bits/stdc++.h>
const int N = 1e5 + 7;
using namespace std;
long long num[11];
int main() {
  long long k;
  string s;
  cin >> k >> s;
  long long sum = 0;
  for (int i = 0; i < s.size(); i++) {
    num[s[i] - '0']++;
    sum += s[i] - '0';
  }
  long long dif = k - sum;
  if (dif <= 0)
    puts("0");
  else {
    long long ans = 0;
    for (long long i = 0; i <= 9; i++) {
      long long tt = 9LL - i;
      long long tmp = (9LL - i) * num[i];
      if (tmp - dif < 0)
        ans += num[i], dif -= tmp;
      else {
        ans += (dif + tt - 1) / (tt);
        break;
      }
    }
    printf("%lld\n", ans);
  }
  return 0;
}
