#include <bits/stdc++.h>
using namespace std;
const long long int N = 2e5 + 5;
void solve() {
  long long int n, i;
  cin >> n;
  string s;
  cin >> s;
  long long int x = s.size();
  for (long long int j = 25; j >= 0; j--) {
    char o = 'a' + j;
    while (1) {
      string l;
      for (i = 0; i < s.size(); i++) {
        if (s[i] == o) {
          if (i != 0 && s[i] - s[i - 1] == 1) {
            break;
          }
          if (i != s.size() - 1 && s[i] - s[i + 1] == 1) {
            break;
          }
        }
        l += s[i];
      }
      i++;
      for (; i < s.size(); i++) {
        l += s[i];
      }
      if (l.size() == s.size()) {
        break;
      }
      s = l;
    }
  }
  cout << x - s.size();
}
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
  long long int t = 1;
  while (t--) {
    solve();
  }
}
