#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
template <typename F, typename S>
ostream &operator<<(ostream &os, const pair<F, S> &p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  typename vector<T>::const_iterator it;
  for (it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  return os << "}";
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &v) {
  os << "[";
  typename set<T>::const_iterator it;
  for (it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  return os << "]";
}
template <typename F, typename S>
ostream &operator<<(ostream &os, const map<F, S> &v) {
  os << "[";
  typename map<F, S>::const_iterator it;
  for (it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << it->first << " = " << it->second;
  }
  return os << "]";
}
long long dx[8] = {1, -1, 0, 0, 1, 1, -1, -1};
long long dy[8] = {0, 0, 1, -1, 1, -1, 1, -1};
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long x = 1;
  while (1) {
    long long ind = -1;
    char c = 'a';
    for (long long i = 0; i < s.size(); i++) {
      if (i == 0) {
        if (s[i + 1] == s[i] - 1) {
          c = s[i];
          ind = i;
        }
      } else if (i && i < n - 1) {
        if ((s[i + 1] == s[i] - 1) || (s[i - 1] == s[i] - 1)) {
          if (s[i] > c) {
            c = s[i];
            ind = i;
          }
        }
      } else {
        if (s[i] - 1 == s[i - 1]) {
          if (s[i] > c) {
            c = s[i];
            ind = i;
          }
        }
      }
    }
    if (ind == -1) break;
    s.erase(ind, 1);
  }
  cout << n - s.size();
}
