#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 5;
string s;
int n;
int solve(void) {
  for (int i = 25; i > 0; i--) {
    char c = 'a' + i;
    size_t pos = s.find(c, 0);
    while (pos != string::npos && s.size() > 1) {
      if (pos > 0 && s[pos - 1] == s[pos] - 1 ||
          pos < s.size() - 1 && s[pos + 1] == s[pos] - 1) {
        s.erase(pos, 1);
        pos = 0;
      } else
        pos++;
      pos = s.find(c, pos);
    }
  }
  return n - s.size();
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  cin >> s;
  int res = 0;
  cout << solve() << endl;
  return 0;
}
