#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  string s;
  long long int k = n;
  cin >> s;
  bool t = false;
  for (long long int i = 25; i >= 0; i--) {
    char ch = 'a' + i;
    for (long long int j = 0; j < n; j++) {
      t = false;
      if (ch == s[j]) {
        if (j > 0 && s[j] - s[j - 1] == 1) {
          t = true;
        } else if (j < n - 1 && s[j] - s[j + 1] == 1) {
          t = true;
        }
      }
      if (t == true) {
        s.erase(s.begin() + j);
        j = max(j - 2, (long long int)-1);
        n--;
      }
    }
  }
  cout << k - n;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  while (t--) {
    solve();
  }
}
