#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n], i, c = 0, sum = 0;
  string s;
  cin >> s;
  for (i = 0; i < n; i++) {
    if (s[i] == 'x') {
      c++;
    } else {
      if (c >= 3) {
        sum += c - 2;
      }
      c = 0;
    }
  }
  if (c != 0) {
    if (c >= 3) {
      sum += c - 2;
    }
  }
  cout << sum;
  return 0;
}
