#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
bool arr[maxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int k;
  string n;
  cin >> k >> n;
  int total = 0;
  for (char c : n) total += c - '0';
  int ans = 0;
  for (char i = '0'; i <= '9' && k > total; i++) {
    for (char c : n) {
      if (c == i) {
        ++ans;
        total += '9' - i;
        if (k <= total) break;
      }
    }
  }
  cout << ans << "\n";
}
