#include "iostream"

using namespace std;

int main() {
  string flag = "E869120";
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    ans += s == flag;
  }
  cout << ans << endl;
  return 0;
}
