#include <bits/stdc++.h>
using namespace std;
string s;
int N;
int torem;
int main() {
  cin >> N;
  cin >> s;
  int chunklen = 0;
  for (int i = 0; i < N; i++) {
    if (s[i] == 'x') {
      chunklen++;
    } else if (chunklen) {
      torem += max(chunklen - 2, 0);
      chunklen = 0;
    }
  }
  torem += max(chunklen - 2, 0);
  cout << torem << endl;
}
