#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k = 0, q = 0;
  cin >> n;
  string s;
  cin >> s;
  for (unsigned i = 0; i < s.length(); i++) {
    if (s[i] != 'F') {
      k++;
    }
    if (s[i] == 'I') {
      q++;
    }
  }
  cout << k - q << endl;
  return 0;
}
