#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const double eps = 1e-6;
inline int lowbit(int x) { return x & (-x); }
template <typename A, typename B, typename C>
inline A fpow(A x, B p, C yql) {
  A ans = 1;
  for (; p; p >>= 1, x = 1LL * x * x % yql)
    if (p & 1) ans = 1LL * x * ans % yql;
  return ans;
}
inline int read() {
  int X = 0, w = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') {
      w = -1;
    }
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    X = (X << 3) + (X << 1) + (c ^ 48);
    c = getchar();
  }
  return X * w;
}
int t, n;
string s;
bool fun(char ch, int x) {
  if (x - 1 >= 0) {
    if (s[x - 1] == ch - 1) return 1;
  }
  if (x + 1 < s.size()) {
    if (s[x + 1] == ch - 1) {
      return 1;
    }
  }
  return 0;
}
void solve() {
  cin >> n;
  cin >> s;
  for (char i = 'z'; i >= 'a'; i--) {
    for (int j = 0; j < s.size(); j++) {
      if (s[j] == i) {
        if (fun(i, j)) {
          s.erase(j, 1);
          j--;
        }
      }
    }
    for (int j = s.size() - 1; j >= 0; j--) {
      if (s[j] == i) {
        if (fun(i, j)) {
          s.erase(j, 1);
          j++;
        }
      }
    }
  }
  cout << n - s.size();
}
int main() {
  std::ios::sync_with_stdio(0);
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
