#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (T i : v) os << i << ' ';
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const set<T>& v) {
  for (T i : v) os << i << ' ';
  return os;
}
template <class T, class S>
ostream& operator<<(ostream& os, const pair<T, S>& v) {
  os << v.first << ' ' << v.second;
  return os;
}
template <class T, class S>
ostream& operator<<(ostream& os, const unordered_map<T, S>& v) {
  for (auto i : v) os << '(' << i.first << "=>" << i.second << ')' << ' ';
  return os;
}
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target( \
    "avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
const long long inf = 1e18;
const long long mod = 1e9 + 7;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
clock_t time_p = clock();
void starboy1299() {
  time_p = clock() - time_p;
  cerr << "Time Taken : " << (float)(time_p) / CLOCKS_PER_SEC << "\n";
}
const long long N = 2e5 + 5;
bool check(char a, char b) {
  if ((a - b) == 1) return 1;
  return 0;
}
void solve() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long ans = 0;
  while (1) {
    char mx = '.';
    long long idx = -1;
    for (long long i = 0; i < s.size(); i++) {
      if (s[i] > mx) {
        if (i > 0 and check(s[i], s[i - 1])) {
          mx = s[i];
          idx = i;
        }
        if (i < s.size() - 1 and check(s[i], s[i + 1])) {
          mx = s[i];
          idx = i;
        }
      }
    }
    if (idx == -1) {
      break;
    }
    s.erase(idx, 1);
    ans++;
  }
  cout << ans << '\n';
}
int32_t main() {
  fast();
  long long t = 1;
  for (long long i = 1; i <= t; i++) {
    solve();
  }
  starboy1299();
}
