#include <bits/stdc++.h>
int main() {
  int n, i, sum = 0, p = 0, ans = 0;
  scanf("%d", &n);
  int num[n];
  char name[n + 1];
  scanf("%s", name);
  for (i = 0; i < n; i++) {
    if (name[i] == 'x') {
      sum = sum + 1;
      if (i == n - 1) {
        num[p++] = sum;
      }
    } else {
      num[p++] = sum;
      sum = 0;
    }
  }
  for (i = 0; i < p; i++) {
    if (num[i] > 2) {
      ans = ans + num[i] - 2;
    }
  }
  printf("%d\n", ans);
}
