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