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