#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  int n;
  cin >> n;
  string str;
  cin >> str;
  multiset<char> s;
  for (int i = 0; i < n; i++) s.insert(str[i]);
  multiset<char>::reverse_iterator tt = s.rbegin();
  while (tt != s.rend()) {
    char c = *tt, x, y;
    for (int i = 0; i < n; i++)
      if (str[i] == c) {
        x = (str[i] - 1);
        if (str[i - 1] == x || str[i + 1] == x) {
          str.erase(i, 1);
          break;
        }
      }
    tt++;
  }
  cout << n - str.size();
}
