#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, o = 0;
void fm() {}
typedef struct pai {
  int x, y;
} pa;
int a[100001], b[100], d[100];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  string a;
  cin >> a;
  int cc = 0, c = 0;
  for (i = 0; i < n - 2; i++) {
    if (a[i] == 'x') {
      if (a[i] == a[i + 1] && i + 2 < n) {
        cc = 2;
        for (j = i + 2; j < n; j++) {
          if (a[j] != 'x') break;
          cc++;
        }
        if (cc > 2) c += (cc - 2);
        i = j - 1;
      }
    }
  }
  cout << c << endl;
  return 0;
}
