#include <bits/stdc++.h>
using namespace std;
int hashr[1005] = {0};
vector<int> res;
int main() {
  int tc;
  tc = 1;
  while (tc--) {
    int n;
    cin >> n;
    string str;
    cin >> str;
    int i = 0;
    int ans = 0;
    while (i < n) {
      int j = i;
      int cnt = 0;
      while (j < n and str[j] == 'x') {
        j++;
        cnt++;
      }
      if (cnt >= 2) ans += cnt - 2;
      i = j + 1;
    }
    cout << ans << "\n";
  }
  return 0;
}
