#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  int k;
  cin >> k;
  string s;
  cin >> s;
  map<int, long long> map1;
  long long count1 = 0;
  for (int i = 0; i < s.length(); i++) {
    map1[s[i] - '0']++;
    count1 += (s[i] - '0');
  }
  long long answer = 0;
  for (map<int, long long>::iterator it1 = map1.begin(); it1 != map1.end();
       it1++) {
    if (count1 < k && it1->first != 9) {
      long long toAdd = (9 - it1->first) * (it1->second);
      if ((count1 + toAdd) >= k) {
        long long rem = k - count1;
        answer += (rem / (9 - it1->first)) + (rem % (9 - it1->first) != 0);
        break;
      } else {
        answer += (it1->second);
        count1 += toAdd;
      }
    }
  }
  cout << answer << endl;
  return 0;
}
