#include <bits/stdc++.h>
using namespace std;
long long Mpow(long long x, long long y, long long p) {
  long long ans = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) ans = (ans * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return ans;
}
void out(vector<int> a) {
  int n = a.size();
  for (auto i = (0); i < (n); i++) {
    cout << a[i] << " ";
  }
  cout << "\n";
}
void out(vector<vector<int>> a) {
  int n = a.size();
  for (auto i = (0); i < (n); i++) {
    int k = a[i].size();
    for (auto j = (0); j < (k); j++) {
      cout << a[i][j] << " ";
    }
    cout << "\n";
  }
}
vector<vector<int>> edge;
void inedge(int n, int m) {
  edge.resize(0);
  edge.resize(n + 1);
  int a, b;
  for (auto i = (0); i < (m); i++) {
    cin >> a >> b;
    edge[a].push_back(b);
    edge[b].push_back(a);
  }
}
vector<int> parent;
int findparent(int i) {
  if (parent[i] == i) return i;
  return parent[i] = findparent(parent[i]);
}
void myunion(int a, int b) {
  int aa = findparent(a);
  int bb = findparent(b);
  if (aa == bb) return;
  if (aa < bb)
    parent[bb] = aa;
  else
    parent[aa] = bb;
}
vector<bool> visited;
void dfs(int ver) {
  if (visited[ver] == true) return;
  visited[ver] = true;
  for (auto i = (0); i < (edge[ver].size()); i++) {
    dfs(edge[ver][i]);
  }
}
bool comp(const pair<int, int> a, const pair<int, int> b) {
  if (a.first < b.first || (a.first == b.first && a.second < b.second))
    return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t, n, m, a, b, k;
  cin >> n;
  string str;
  cin >> str;
  for (int i = 25; i > 0; i--) {
    char c = 'a' + i;
    int ind = 0;
    while (true) {
      if (ind == str.size() || str.size() == 1) break;
      if (str[ind] != c) {
        ind++;
        continue;
      }
      if (ind == 0) {
        if (str[ind + 1] == c - 1) {
          str.erase(str.begin() + ind);
          continue;
        }
        ind++;
      } else if (ind == str.size() - 1) {
        if (str[ind - 1] == c - 1) {
          str.erase(str.begin() + ind);
          break;
        }
        ind++;
      } else {
        if (str[ind - 1] == c - 1) {
          str.erase(str.begin() + ind);
          ind--;
          continue;
        } else if (str[ind + 1] == c - 1) {
          str.erase(str.begin() + ind);
          ind--;
          continue;
        } else {
          ind++;
        }
      }
    }
  }
  cout << n - str.size() << "\n";
  return 0;
}
