#include <bits/stdc++.h>
using namespace std;
const long long N = 1000002;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  vector<char> v;
  for (char c : s) v.push_back(c);
  sort(v.rbegin(), v.rend());
  for (auto ch : v) {
    if (s.length() < 2) break;
    string st = "";
    for (long long i = 0; i < s.length(); i++) {
      long long fl = 0;
      if (s[i] == ch) {
        if (i != 0 && (s[i] - s[i - 1] == 1)) fl = 1;
        if (i != (s.length() - 1) && s[i] - s[i + 1] == 1) fl = 1;
      }
      if (!fl) st += s[i];
    }
    s = st;
  }
  cout << (n - s.length());
  return 0;
}
