#include <bits/stdc++.h>
using namespace std;
void cs(string s) { cout << s << " "; }
void ci(long long int i) { cout << i << " "; }
int main() {
  long long int n;
  cin >> n;
  string s;
  cin >> s;
  long long int ans = 0;
  char c = 'a';
  long long int ind = -1;
  while (1) {
    c = 'a';
    ind = -1;
    for (long long int i = 0; i < s.length(); i++) {
      if (s[i] - 'a' > c - 'a') {
        if ((i - 1 >= 0 and s[i - 1] - 'a' == s[i] - 'a' - 1) or
            (i + 1 < s.length() and s[i + 1] - 'a' == s[i] - 'a' - 1)) {
          c = s[i];
          ind = i;
        }
      }
    }
    if (ind == -1)
      break;
    else {
      ans++;
      s.erase(ind, 1);
    }
  }
  ci(ans);
  cout << "\n";
}
