#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string str;
  cin >> n >> str;
  for (char i = 'z'; i > 'a'; i--) {
    if (str.size() == 1) {
      break;
    }
    while (1) {
      bool ok = false;
      for (int j = 0; j < str.size(); j++) {
        if (str[j] != i) continue;
        if (j == 0) {
          if (str[j + 1] == i - 1) {
            str.erase(str.begin() + j);
            ok = true;
            break;
          }
        } else if (j == str.size() - 1) {
          if (str[j - 1] == i - 1) {
            str.erase(str.begin() + j);
            ok = true;
            break;
          }
        } else {
          if (str[j - 1] == i - 1 || str[j + 1] == i - 1) {
            str.erase(str.begin() + j);
            ok = true;
            break;
          }
        }
      }
      if (ok == false) break;
    }
  }
  cout << n - str.size() << endl;
  return 0;
}
