#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 7, offset = 4e5;
long long lf[109], rg[109];
queue<long long> vc[30];
int32_t main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  s = "1" + s + "1";
  for (long long i = 1; i <= n; i++) vc[s[i] - 96].push(i);
  for (long long i = 1; i <= n; i++) lf[i] = i - 1, rg[i] = i + 1;
  long long cnt = 0;
  for (long long i = 26; i >= 1; i--) {
    while (vc[i].size()) {
      long long l = vc[i].size();
      for (long long j = 1; j <= l; j++) {
        auto x = vc[i].front();
        vc[i].pop();
        if (s[x] - 1 == s[lf[x]]) {
          cnt++;
          rg[lf[x]] = rg[x];
          lf[rg[x]] = lf[x];
        } else if (s[x] - 1 == s[rg[x]]) {
          cnt++;
          lf[rg[x]] = lf[x];
          rg[lf[x]] = rg[x];
        } else
          vc[i].push(x);
      }
      if (l == vc[i].size()) break;
    }
  }
  cout << cnt << "\n";
}
