#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, iter = 0, sum = 0, ans = 0, mini, h, k, arr[10] = {0}, num, diff;
  string s;
  cin >> k;
  cin >> s;
  for (auto i : s) {
    num = (int)i - '0';
    arr[num]++;
    sum += num;
  }
  iter = 0;
  while (sum < k) {
    diff = k - sum;
    h = (diff) / (9 - iter);
    if (diff % (9 - iter)) h++;
    mini = min(arr[iter], h);
    sum += (mini * (9 - iter));
    ans += mini;
    iter++;
  }
  cout << ans << endl;
  return 0;
}
