#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k, cntx = 0, cnt = 0;
  cin >> n;
  string s;
  cin >> s;
  for (size_t i = 0; i < n; i++) {
    if (s[i] == 'x') {
      cntx++;
    } else {
      if (cntx > 2) {
        cnt += cntx - 2;
      }
      cntx = 0;
    }
  }
  if (cntx > 2) {
    cnt += cntx - 2;
  }
  cntx = 0;
  cout << cnt;
  return 0;
}
