#include <bits/stdc++.h>
const double EPS = (1e-7);
const double pi = acos(-1);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
inline char nc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
template <typename T = int>
inline T in() {
  char c = nc();
  T x = 0;
  int f = 1;
  for (; c > '9' || c < '0'; c = nc())
    if (c == '-') f = -1;
  for (; c >= '0' && c <= '9'; x = x * 10 + c - '0', c = nc())
    ;
  x *= f;
  return x;
}
using namespace std;
const int MAX = (int)(100);
const int OO = (int)(1e9 + 7);
int main() {
  int n;
  cin >> n;
  string x;
  cin >> x;
  int ans = 0;
  for (int i = 0; i < ((int)((x).size())); ++i) {
    if (x[i] == 'x') {
      int j = i;
      while (x[j++] == 'x') {
      }
      if ((j - i) > 3) {
        ans += (j - i - 3);
      }
      i = j - 1;
    }
  }
  cout << ans << endl;
  return 0;
}
