#include <bits/stdc++.h>
int main() {
  int n, count = 0;
  std::list<char> nums;
  std::list<char>::iterator iter = nums.end();
  std::cin >> n;
  for (int i = 0; i < n; i += 1) {
    char temp;
    std::cin >> temp;
    nums.push_back(temp);
  }
  while (1) {
    int i = 0;
    for (std::list<char>::iterator it = nums.begin(); it != nums.end();
         it++, i++) {
      if (i < nums.size() - 1) {
        auto it_plus = it;
        it_plus++;
        if (*it - *it_plus == 1 &&
            (iter == nums.end() || (iter != nums.end() && *iter < *it)))
          iter = it;
      }
      if (i > 0) {
        auto it_minus = it;
        it_minus--;
        if (*it - *it_minus == 1 &&
            (iter == nums.end() || (iter != nums.end() && *iter < *it)))
          iter = it;
      }
    }
    if (iter != nums.end()) {
      nums.erase(iter);
      iter = nums.end();
      count += 1;
    } else
      break;
  }
  std::cout << count;
  return 0;
}
