#include <bits/stdc++.h>
using namespace std;
set<long long int> v;
set<long long int>::reverse_iterator it, s, p;
map<long long int, vector<long long int> > u;
map<long long int, long long int> ex, dp;
map<long long int, vector<long long int> >::iterator it1;
void solve() {
  long long int n, ans = 0;
  cin >> n;
  long long int x, y;
  string s;
  cin >> s;
  long long int k = 0;
  for (long long int i = 0; i < n; i++) {
    if (s[i] != 'x') {
      if (k > 2) {
        ans += k - 2;
      }
      k = 0;
    } else
      k++;
  }
  if (k > 2) {
    ans += k - 2;
    k = 0;
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
