#include <bits/stdc++.h>
using namespace std;
int n;
char s[110];
bool isDel[110];
int szS;
char target;
int main() {
  scanf("%d\n", &n);
  scanf("%s", s);
  target = 'z';
  szS = n;
  bool isFound = false;
  int count = 0;
  int curPos = szS - 1;
  for (char t = 'z'; t >= 'a'; t--) {
    for (int i = 0; i < n; i++) isDel[i] = false;
    for (int i = 1; i < n; i++) {
      if (isDel[i] == true) continue;
      if (t == s[i]) {
        if (s[i - 1] == (t - 1)) {
          int p = i;
          while ((p < n) && (s[p] == t)) {
            if (isDel[p] == false) {
              isDel[p] = true;
              count++;
            }
            p++;
          }
        }
      }
    }
    for (int i = n - 2; i >= 0; i--) {
      if (isDel[i] == true) continue;
      if (t == s[i]) {
        if (s[i + 1] == (t - 1)) {
          int p = i;
          while ((p >= 0) && (s[p] == t)) {
            if (isDel[p] == false) {
              isDel[p] = true;
              count++;
            }
            p--;
          }
        }
      }
    }
    char newS[110];
    int szNew = 0;
    for (int i = 0; i < n; i++) {
      if (isDel[i] == false) {
        newS[szNew] = s[i];
        szNew++;
      }
    }
    for (int i = 0; i < szNew; i++) {
      s[i] = newS[i];
    }
    for (int i = szNew; i < szS; i++) {
      s[i] = '\0';
    }
    szS = szNew;
  }
  printf("%d\n", count);
  return 0;
}
