#include <bits/stdc++.h>
using namespace std;
const long long int prm1 = 95676260903887607;
const long long int prm2 = 999998727899999;
const long long int prm3 = 1012345678901;
const int prm4 = 2147483647;
const int prm5 = 998244353;
const int prm6 = 999999937;
const int prm7 = 9699690;
const int maxn = 105;
bool flag[maxn];
int Next[maxn];
int Prev[maxn];
int n;
void del(int x) {
  flag[x] = true;
  Next[Prev[x]] = Next[x];
  Prev[Next[x]] = Prev[x];
}
int main() {
  cin >> n;
  string s, t;
  cin >> s;
  t = "abcdefghijklmnopqrstuvwxyz";
  Prev[0] = -1;
  Next[0] = 1;
  Prev[n - 1] = n - 2;
  Next[n - 1] = -1;
  for (int i = 1; i < n - 1; i++) {
    Prev[i] = i - 1;
    Next[i] = i + 1;
  }
  int ans = false;
  for (int i = 24; ~i; i--) {
    for (int j = 0; j < n; j++) {
      bool brk = true;
      while (s[j] == t[i] && brk) {
        if (Next[j] != -1 && s[Next[j]] == t[i + 1])
          del(Next[j]), ans++;
        else if (Prev[j] != -1 && s[Prev[j]] == t[i + 1])
          del(Prev[j]), ans++;
        else
          brk = false;
      }
    }
  }
  cout << ans;
  return 0;
}
