#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 5;
const long long INF64 = 1e18;
template <typename T>
string to_string(const vector<T> &v) {
  string ret = "<";
  for (auto it : v) {
    ret += to_string(it) + ", ";
  }
  ret.pop_back();
  ret.pop_back();
  ret += ">";
  return ret;
}
void debug_print() { cerr << endl; }
template <typename T, typename... U>
void debug_print(T t, U... u) {
  cerr << " " << to_string(t);
  debug_print(u...);
}
const int N = 1e5 + 5;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  for (int i = 'z'; i > 'a'; i--) {
    bool fnd = false;
    for (int j = s.size() - 1; j >= 0; j--) {
      if ((j - 1 >= 0 && s[j] == i && s[j - 1] == i - 1) ||
          (j + 1 < s.size() && s[j] == i && s[j + 1] == i - 1)) {
        s.erase(j, 1);
        fnd = true;
      }
    }
    if (fnd) i++;
  }
  cout << n - s.size() << endl;
  return 0;
}
