#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
const double Pi = acos(-1.0);
const double epsilon = Pi / 180.0;
const int maxn = 2e5 + 10;
char s[110];
int l[110], r[110];
vector<int> v[30];
int findl(int x) {
  if (s[l[x]] == s[x]) {
    return findl(l[x]);
  } else
    return l[x];
}
int findr(int x) {
  if (s[r[x]] == s[x]) {
    return findr(r[x]);
  } else
    return r[x];
}
int main() {
  int n;
  scanf("%d", &(n));
  ;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
  }
  for (int i = 1; i <= n; i++) {
    l[i] = i - 1;
    r[i] = i + 1;
    v[s[i] - 96].push_back(i);
  }
  int ans = 0;
  for (int i = 26; i >= 1; i--) {
    if (v[i].size() == 0) continue;
    for (int j = 0; j <= v[i].size() - 1; j++) {
      int now = v[i][j];
      int x = findl(now);
      int y = findr(now);
      if ((char)(s[x] + 1) == s[now] || (char)(s[y] + 1) == s[now]) {
        ans++;
        r[l[now]] = r[now];
        l[r[now]] = l[now];
      }
    }
  }
  printf("%d\n", ans);
}
