#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-O3")
#pragma GCC optimize("-Ofast")
using namespace std;
string s;
int n, ans, i;
int main() {
  ios_base::sync_with_stdio(NULL);
  iostream::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  cin >> s;
  ans = 0;
  while (1) {
    int nm = -1, c = -1;
    n = s.size();
    for (i = 0; i < n; i++) {
      if (i + 1 < n && s[i + 1] == s[i] - 1) {
        if (c <= s[i]) c = s[i], nm = i;
      }
      if (i - 1 >= 0 && s[i - 1] == s[i] - 1) {
        if (c <= s[i]) c = s[i], nm = i;
      }
    }
    if (c != -1) {
      ans++;
      s.erase(nm, 1);
    } else
      break;
  }
  cout << ans;
}
