#include <bits/stdc++.h>
using namespace std;
const int mxn = 1000005;
int arr[mxn];
string s;
int n;
void solve() {
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'x') {
      int j = i;
      while (j < n && s[j] == 'x') j++;
      if (j - i >= 3) {
        ans += j - i - 2;
      }
      i = j;
    }
  }
  cout << ans << '\n';
}
void read() { cin >> n >> s; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int T = 1;
  while (T--) read(), solve();
  return 0;
}
