#include <bits/stdc++.h>
using namespace std;
int n, c;
char s[100005];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i < n; i++) {
    if (s[i] == 'O' && s[i + 1] == 'X') {
      c++;
      i++;
    }
    if (s[i] == 'X' && s[i + 1] == 'O') {
      c++;
      i++;
    }
  }
  cout << c;
}
