#include <bits/stdc++.h>
using namespace std;
long long pw(long long b, long long r) {
  long long ans = 1;
  while (r) {
    if (r & 1) ans = (ans * b) % 1000000007;
    b = (b * b) % 1000000007;
    r >>= 1;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  string ans = s;
  bool flag = true;
  while (flag) {
    pair<long long, long long> mx = {-1, -1};
    for (int i = 0; i < ans.length(); i++) {
      if (i > 0 && ans[i] == ans[i - 1] + 1) {
        if (mx.first < ans[i] - 'a') mx = {ans[i] - 'a', i};
      } else if (i < n - 1 && ans[i] == ans[i + 1] + 1 &&
                 mx.first < ans[i] - 'a')
        mx = {ans[i] - 'a', i};
    }
    if (mx.first == -1) {
      flag = false;
      continue;
    }
    string dum = "";
    for (int i = 0; i < ans.length(); i++)
      if (i != mx.second) dum.push_back(ans[i]);
    ans = dum;
  }
  cout << s.length() - ans.length() << '\n';
  return 0;
}
