#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string str = s;
  for (char cur = 'z'; cur >= 'a'; cur--) {
    bool done = true;
    string generated = "";
    for (int i = 0; i < s.size(); i++)
      if (s[i] == cur &&
          (generated.size() != 0 && generated.back() + 1 == cur ||
           i + 1 != s.size() && s[i + 1] + 1 == cur)) {
        done = false;
      } else {
        generated += s[i];
      }
    s = generated;
    if (!done) cur++;
  }
  cout << str.size() - s.size() << endl;
  return 0;
}
