#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count = 0, count1 = 0;
  cin >> n;
  char a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 'x')
      count++;
    else {
      if (count >= 3) {
        count1 += count - 2;
        count = 0;
      } else
        count = 0;
    }
  }
  if (count >= 3) count1 += count - 2;
  cout << count1 << endl;
}
