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