#include <bits/stdc++.h>
using namespace std;
string s;
int solve() {
  for (int j = 25; j >= 0; j--) {
    char c = j + 'a';
    for (int i = 0; i < s.length(); i++) {
      if (s[i] != c) continue;
      if (i > 0) {
        if (s[i - 1] == j - 1 + 'a') {
          s.erase(i, 1);
          return 1;
        }
      }
      if (i < s.length() - 1) {
        if (s[i + 1] == j - 1 + 'a') {
          s.erase(i, 1);
          return 1;
        }
      }
    }
  }
  return 0;
}
int main() {
  int n;
  cin >> n >> s;
  int ans = 0;
  while (solve()) {
    ans++;
  }
  cout << ans << endl;
  return 0;
}
