#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  bool flag = true;
  string ans1;
  vector<int> ind;
  int cnt = 0;
  while (flag) {
    flag = false;
    int index = INT_MAX;
    string ans;
    for (int i = 0; i < n - cnt; i++) {
      if (i != n - cnt && s[i] == s[i + 1] + 1) {
        if (index == INT_MAX) {
          index = i;
        } else {
          index = s[i] > s[index] ? i : index;
        }
        flag = true;
      } else if (i != n - cnt && s[i] == s[i + 1] - 1) {
        if (index == INT_MAX) {
          index = i + 1;
        } else {
          index = s[i + 1] > s[index] ? i + 1 : index;
        }
        flag = true;
      } else if (i != 0 && s[i] == s[i - 1] + 1) {
        if (index == INT_MAX) {
          index = i;
        } else {
          index = s[i] > s[index] ? i : index;
        }
        flag = true;
      } else if (s[i] == s[i - 1] - 1) {
        if (index == INT_MAX) {
          index = i - 1;
        } else {
          index = s[i - 1] > s[index] ? i - 1 : index;
        }
        flag = true;
      }
    }
    if (index != INT_MAX) {
      s.erase(index, 1);
      cnt++;
    }
  }
  cout << cnt << endl;
}
