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