#include <bits/stdc++.h>
const int N = 100005;
const int inf = 1000005;
using namespace std;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  int flag = 0;
  for (int i = 0; i < n - 2; i++) {
    if (s[i] == 'x' && s[i + 1] == 'x' && s[i + 2] == 'x' && i + 2 < n &&
        i + 1 < n) {
      flag = 1;
      break;
    }
  }
  if (flag == 0) {
    cout << "0\n";
    return 0;
  } else {
    int count = 0;
    flag = 0;
    while (1) {
      flag = 0;
      for (int i = 0; i < s.size(); i++) {
        n = s.size();
        if (s[i] == 'x' && s[i + 1] == 'x' && s[i + 2] == 'x' && i + 2 < n &&
            i + 1 < n) {
          count++;
          s.erase(s.begin() + i);
          flag = 1;
          break;
        }
      }
      if (flag == 0) break;
    }
    cout << count << "\n";
    return 0;
  }
}
