#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int k, sum, ans, s[15];
char n[N];
int main() {
  scanf("%d%s", &k, n);
  int len = strlen(n);
  for (int i = 0; i < len; i++) {
    int t = n[i] - '0';
    sum += t;
    s[t]++;
  }
  if (sum >= k)
    printf("0");
  else {
    sum = k - sum;
    for (int i = 0; i < 9; i++) {
      if ((9 - i) * s[i] <= sum)
        sum -= (9 - i) * s[i], ans += s[i];
      else {
        if (sum % (9 - i))
          ans += sum / (9 - i) + 1;
        else
          ans += sum / (9 - i);
        sum = 0;
      }
      if (sum == 0) break;
    }
    printf("%d", ans);
  }
  return 0;
}
