#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  scanf("%d", &k);
  int l, i, j;
  char s[100010];
  scanf("%s", s);
  l = strlen(s);
  int a[15];
  memset(a, 0, sizeof(a));
  int ans = 0;
  for (i = 0; i < l; i++) {
    a[s[i] - 48]++;
    ans += s[i] - 48;
  }
  j = 0;
  int num;
  num = 0;
  while (ans < k) {
    while (a[j] > 0 && ans < k) {
      ans += 9 - j;
      num++;
      a[j]--;
    }
    if (a[j] == 0) j++;
  }
  printf("%d\n", num);
  return 0;
}
