#include <bits/stdc++.h>
using namespace std;
int n;
char s[1500];
void del(int k) {
  int i;
  for (i = k; i < n; i++) s[i] = s[i + 1];
  n--;
}
int main() {
  int st, i, sign, m, pp;
  scanf("%d", &n);
  m = n;
  scanf("%s", s + 1);
  while (1) {
    pp = n;
    for (i = 26; i > 1; i--) {
      st = 1;
      while (st <= n) {
        if ((int)(s[st]) != i + 96)
          st++;
        else {
          sign = 0;
          if (st > 1 && (int)(s[st - 1]) == i + 96 - 1) sign = 1;
          if (st < n && (int)(s[st + 1]) == i + 96 - 1) sign = 1;
          if (sign == 1) {
            del(st);
            st = 1;
            i = 26;
          } else
            st++;
        }
      }
    }
    if (pp == n) break;
  }
  printf("%d\n", m - n);
}
