#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, j, t, m, k, l, sum, v1, r, q, f, x, kol, y, p, z;
  string s;
  cin >> p;
  cin >> s;
  char a, b;
  k = 0;
  for (j = 25; j > 0; j--) {
    for (i = p - 1; i > -1; i--) {
      if (s[i] == 97 + j) {
        a = s[i];
        b = s[i - 1];
        if (a == b + 1) {
          s.erase(s.begin() + i);
          k = k + 1;
          p = p - 1;
          if (i != p) {
            i++;
          }
        } else {
          if (i != p - 1) {
            b = s[i + 1];
            if (a == b + 1) {
              s.erase(s.begin() + i);
              k = k + 1;
              p = p - 1;
              if (i != p) {
                i++;
              }
            }
          }
        }
      }
    }
  }
  cout << k << endl;
  return 0;
}
