#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c = 0, lc = 0;
  cin >> n;
  string s;
  cin >> s;
  char ch;
  ios::sync_with_stdio(0);
  cin.tie(0);
  for (int i = 0; i < n; i++) {
    ch = s[i];
    if (ch == 'x')
      lc++;
    else {
      if (lc >= 3) c = c + (lc - 2);
      lc = 0;
    }
  }
  if (lc >= 3) c = c + (lc - 2);
  cout << c;
}
