#include <bits/stdc++.h>
using namespace std;
const int OO = (int)1e9 + 7;
using namespace std;
long long inv(long long a, long long b) {
  return 1 < a ? b - inv(b % a, a) * b / a : 1;
}
long long Pow(long long B, long long P) {
  long long R = 1;
  while (P > 0) {
    if (P & 1) R = (R * B);
    P /= 2;
    B = (B * B);
  }
  return R;
}
long long GCD(long long a, long long b) {
  while (b) {
    b ^= a ^= b ^= a %= b;
  }
  return a;
}
long long LCM(long long a, long long b) { return (a / GCD(a, b) * b); }
long long BigMod(long long B, long long P, long long M) {
  long long R = 1;
  while (P > 0) {
    if (P & 1) {
      R = (R * B) % M;
    }
    P /= 2;
    B = (B * B) % M;
  }
  return (long long)R;
}
int nxtremove(string s) {
  if (s.size() <= 1) return -1;
  int pos = -1;
  char ch = 0;
  if (s[0] == s[1] + 1 && s[0] > ch) {
    pos = 0;
    ch = s[0];
  }
  if (s[s.size() - 1] == s[s.size() - 2] + 1 && s[s.size() - 1] > ch) {
    pos = s.size() - 1;
    ch = s[pos];
  }
  for (long long i = 1; i < s.size() - 1; ++i) {
    if ((s[i] == s[i - 1] + 1 || s[i] == s[i + 1] + 1) && s[i] > ch) {
      pos = i;
      ch = s[pos];
    }
  }
  return pos;
}
int main() {
  ios::sync_with_stdio(0);
  int n;
  string txt;
  cin >> n >> txt;
  int ans = 0;
  while (1) {
    int pos = nxtremove(txt);
    if (pos == -1) break;
    ++ans;
    string ts = "";
    for (long long i = 0; i < txt.size(); ++i) {
      if (i == pos) continue;
      ts += txt[i];
    }
    txt = ts;
  }
  cout << ans;
  return 0;
}
