#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) { return (y ? gcd(y, x % y) : x); }
int main() {
  int x, arr[100009] = {0};
  char s;
  cin >> x;
  while (x--) {
    cin >> s;
    s = tolower(s);
    arr[s - 'a']++;
  }
  if (arr['i' - 'a'] == 0) {
    cout << arr['a' - 'a'] << endl;
  } else
    cout << arr['i' - 'a'] << endl;
}
