#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    long long n;
    cin >> n;
    string s;
    cin >> s;
    long long ans = 0;
    for (long long i = 25; i >= 1; i--) {
      for (long long tt = 0; tt <= 99; tt++) {
        vector<long long> cnt;
        for (long long j = 0; j <= s.size() - 1; j++)
          if (s[j] - 'a' == i) cnt.push_back(j);
        if (cnt.size() == 0) continue;
        long long erased = 0;
        for (auto x : cnt) {
          if (x - erased == 0) {
            if (s[x - erased + 1] + 1 == s[x - erased]) {
              ans++;
              s.erase(x - erased, 1);
              erased++;
            }
          } else if (x - erased == s.size() - 1) {
            if (s[x - 1 - erased] + 1 == s[x - erased]) {
              ans++;
              s.erase(x - erased, 1);
              erased++;
            }
          } else {
            if (s[x - 1 - erased] + 1 == s[x - erased] or
                s[x + 1 - erased] + 1 == s[x - erased]) {
              ans++;
              s.erase(x - erased, 1);
              erased++;
            }
          }
        }
      }
    }
    cout << ans;
  }
  return 0;
}
