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