#include <bits/stdc++.h>
using namespace std;
void solve() {}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> ans;
  int c(0);
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == 'x') {
      c++;
    } else {
      ans.push_back(c);
      c = 0;
    }
  }
  ans.push_back(c);
  c = 0;
  for (int x : ans) {
    if (x >= 3) {
      c += x - 2;
    }
  }
  cout << c;
}
