#include <bits/stdc++.h>
using namespace std;
long long arr[10];
int main() {
  long long k;
  string second;
  cin >> k >> second;
  long long sz = second.size();
  long long sum = 0;
  for (int i = 0; i < sz; i++) {
    char ch = second[i];
    long long dig = ch - '0';
    arr[dig]++;
    sum += dig;
  }
  if (sum >= k) {
    cout << 0;
  } else {
    long long diff = k - sum;
    long long temp = 0;
    long long last = -1;
    long long ans = 0;
    for (int i = 0; i < 10; i++) {
      temp += (9 - i) * arr[i];
      if (temp >= diff) {
        last = i;
        break;
      }
      ans += arr[i];
    }
    temp -= (9 - last) * arr[last];
    long long amt = diff - temp;
    ans += ceil(double(amt) / (9 - last));
    cout << ans;
  }
}
