#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long inf = 1e18;
const long long epi = 1e-9;
const double pi = 3.1415926535897;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, i, x, j, m, z, p;
  char c;
  cin >> n;
  vector<char> b[26];
  b[0].push_back('0');
  for (i = 1; i < (n + 1); i++) {
    cin >> c;
    b[0].push_back(c);
  }
  b[0].push_back('0');
  n = n + 2;
  m = 0, z = 0;
  for (auto a = 'z'; a >= 'b'; a--) {
    for (i = 0; i < (n); i++) {
      if (b[z][i] == a) {
        x = 0;
        j = i;
        while (i <= n && b[z][i] == a) {
          x++;
          i++;
        }
        if ((b[z][j - 1] == a - 1 || b[z][i] == a - 1)) {
          m += x;
        } else {
          for (p = 0; p < (x); p++) {
            b[z + 1].push_back(b[z][i - 1]);
          }
        }
        b[z + 1].push_back(b[z][i]);
      } else {
        b[z + 1].push_back(b[z][i]);
      }
    }
    n = b[z + 1].size();
    z++;
  }
  cout << m;
  return 0;
}
