#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int main() {
  scanf("%d", &n);
  cin >> s;
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    int pos = -1, len = s.length();
    if (s[0] - 1 == s[1]) pos = 0;
    if (s[len - 1] - 1 == s[len - 2])
      if (pos == -1 || s[pos] < s[len - 1]) pos = len - 1;
    for (int j = 1; j < s.length() - 1; ++j)
      if (s[j] - 1 == s[j - 1] || s[j] - 1 == s[j + 1]) {
        if (pos == -1 || s[pos] < s[j]) pos = j;
      }
    if (pos == -1) break;
    ans++;
    s.erase(pos, 1);
  }
  printf("%d\n", ans);
  return 0;
}
