#include <bits/stdc++.h>
using namespace std;
const long long int M = 1e9 + 7;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t, n, i, j, k;
  cin >> n;
  string str;
  cin >> str;
  vector<long long int> d[26];
  long long int cnt = 1;
  for (i = 25; i > 0; i--) {
    cnt = 1;
    while (cnt) {
      t = str.size();
      cnt = 0;
      for (long long int j = 0; j < t; j++) {
        if (str[j] == ('a' + i)) {
          if (j > 0 && str[j - 1] == ('a' + (i - 1))) {
            d[i].push_back(j);
            continue;
          }
          if (j < n - 1 && str[j + 1] == ('a' + (i - 1))) {
            d[i].push_back(j);
          }
        }
      }
      k = 0;
      for (auto it = d[i].begin(); it != d[i].end(); it++) {
        str.erase(str.begin() + *it - k);
        k++;
      }
      cnt += k;
      d[i].clear();
    }
  }
  cout << n - str.size() << "\n";
  return 0;
}
