#include <bits/stdc++.h>
using namespace std;
const long long ff = 1e6 + 1;
const long long inf = 1e17 + 1;
long long n, ans, vis[ff];
char s[ff];
signed main() {
  cin >> n;
  cin >> s + 1;
  for (long long i = 26; i >= 2; --i) {
    for (long long j = 1; j <= n; ++j) {
      long long pr = j - 1, nx = j + 1, co = (long long)(s[j] - 'a' + 1);
      if (co != i || vis[j]) continue;
      while (pr > 0 && vis[pr]) pr--;
      while (nx <= n && vis[nx]) nx++;
      long long t1 = (long long)(s[pr] - 'a' + 1);
      long long t2 = (long long)(s[nx] - 'a' + 1);
      if (pr > 0)
        if (t1 == co - 1) ans++, vis[j] = 1;
      if (pr <= n && !vis[j])
        if (t2 == co - 1) ans++, vis[j] = 1;
    }
    for (long long j = n; j >= 1; --j) {
      long long pr = j - 1, nx = j + 1, co = (long long)(s[j] - 'a' + 1);
      if (co != i || vis[j]) continue;
      while (pr > 0 && vis[pr]) pr--;
      while (nx <= n && vis[nx]) nx++;
      long long t1 = (long long)(s[pr] - 'a' + 1);
      long long t2 = (long long)(s[nx] - 'a' + 1);
      if (pr > 0)
        if (t1 == co - 1) ans++, vis[j] = 1;
      if (pr <= n && !vis[j])
        if (t2 == co - 1) ans++, vis[j] = 1;
    }
  }
  cout << ans;
}
