#include <bits/stdc++.h>
using namespace std;
inline void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int len = s.size();
  for (char i = 'a' + 25; i >= 'a'; --i) {
    for (int k = 1; k <= 100; ++k)
      for (int j = 0; j < len; ++j) {
        if (s[j] == i && ((j > 0 && s[j - 1] == i - 1) ||
                          (j < len - 1 && s[j + 1] == i - 1))) {
          s.erase(s.begin() + j);
          len--;
          break;
        }
      }
  }
  cout << n - len << endl;
}
int main() {
  int T = 1;
  for (int i = 0; i < T; ++i) solve();
  return 0;
}
