#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 10;
long long n;
string s;
int main() {
  cin >> n;
  cin >> s;
  if (n == 1) {
    cout << "0\n";
    return 0;
  }
  long long res = 0;
  while (true) {
    long long ma = 0, p = -1;
    for (long long i = 1; i <= s.length() - 1; i++) {
      long long l = int(s[i - 1]) - 96;
      long long r = int(s[i]) - 96;
      if (l - r == 1) {
        if (ma < l) {
          p = i - 1;
          ma = l;
        }
      }
      if (r - l == 1) {
        if (ma < r) {
          p = i;
          ma = r;
        }
      }
    }
    if (ma == 0) {
      break;
    }
    s.erase(p, 1);
    res++;
  }
  cout << res;
}
