#include <bits/stdc++.h>
using namespace std;
signed main() {
  std ::ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, res = 0;
  cin >> n;
  string s;
  cin >> s;
  char mx = 'a', mi = 'z';
  for (long long i = 0; i < n; i++) mx = max(mx, s[i]), mi = min(mi, s[i]);
  map<char, bool> mp;
  mp[mx] = true;
  string prev = s;
  while (mx != mi) {
    for (long long i = 0; i < s.length(); i++) {
      if (s[i] == mx) {
        if ((i - 1 >= 0 && s[i - 1] == char(s[i] - 1)) ||
            (i + 1 < n && s[i + 1] == char(s[i] - 1))) {
          res++;
          s.erase(s.begin() + i);
          i--;
        }
      }
    }
    if (s != prev) {
      prev = s;
      continue;
    }
    char tmp = 'a';
    for (long long i = 0; i < s.length(); i++)
      if (mp[s[i]] == false) tmp = max(tmp, s[i]);
    mx = tmp;
    mp[mx] = true;
    prev = s;
  }
  cout << res;
}
