#include <bits/stdc++.h>
using namespace std;
int delta[4][2] = {{-1, -0}, {0, 1}, {1, 0}, {0, -1}};
long long calc_pow(long long a, long long p, long long m = 1000000007) {
  long long res = 1;
  while (p > 0) {
    if (p & 1) res = (res * a) % m;
    a = (a * a) % m;
    p >>= 1;
  }
  return res;
}
long long calc_pow_without_mod(long long a, long long p) {
  long long res = 1;
  while (p > 0) {
    if (p & 1) res = res * a;
    a = a * a;
    p >>= 1;
  }
  return res;
}
void func() {
  long long n;
  cin >> n;
  unordered_map<char, char> prev;
  char x = 'b', y = 'a';
  while (x <= 'z') {
    prev[x] = y;
    x++, y++;
  }
  string s;
  cin >> s;
  int ans = 0;
  while (1) {
    int cnt = 0;
    for (char ch = 'z'; ch >= 'b'; ch--) {
      int i = 0;
      while (i < s.size()) {
        if (s[i] == ch) {
          if (i && s[i - 1] == prev[s[i]] ||
              i != s.size() - 1 && s[i + 1] == prev[s[i]]) {
            s.erase(s.begin() + i);
            i = 0;
            cnt++;
            ans++;
            continue;
          }
        }
        i++;
      }
    }
    if (cnt == 0) break;
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  func();
  return 0;
}
