#include <bits/stdc++.h>
using namespace std;
long long cal(long long n, long long r) {
  if (r > n) return 0ll;
  if (n == 0 || r == 0) return 1ll;
  r = min(r, n - r);
  long long a = 1;
  for (long long i = 1; i <= r; i++) {
    a = (a * (n - i + 1)) % 998244353;
    a = (a / i) % 998244353;
  }
  return a % 998244353;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    int n, i, j;
    string s;
    cin >> n >> s;
    j = n;
    while (j > 1) {
      vector<pair<char, int> > v;
      if (s[0] == s[1] + 1) v.push_back({s[0], 0});
      if (s[j - 1] == s[j - 2] + 1) v.push_back({s[j - 1], j - 1});
      for (i = 1; i < j - 1; i++)
        if (s[i] == s[i - 1] + 1 || s[i] == s[i + 1] + 1)
          v.push_back({s[i], i});
      if (v.empty()) break;
      sort(v.begin(), v.end());
      int pos = v[v.size() - 1].second;
      for (i = pos; i < j - 1; i++) s[i] = s[i + 1];
      --j;
    }
    cout << n - j;
  }
}
