#include <bits/stdc++.h>
using namespace std;
const int MAX = 50;
int x[MAX];
int y[MAX];
char d[MAX];
bool vanished[MAX];
int z;
struct M {
  int p1;
  int p2;
  int t;
};
struct Compare {
  bool operator()(M &lhs, M &rhs) { return (lhs.t - rhs.t); };
};
priority_queue<M, vector<M>, Compare> pq;
void fill(int p1, int p2) {
  if (d[p1] == d[p2]) {
    return;
  }
  if (d[p1] == 'N' && d[p2] == 'S') {
    if (y[p1] > y[p2])
      return;
    else {
      M meet;
      meet.t = y[p2] - y[p1];
      meet.p1 = p1;
      meet.p2 = p2;
      pq.push(meet);
    }
  }
  if (d[p1] == 'W' && d[p2] == 'E') {
    if (x[p1] < x[p2])
      return;
    else {
      M meet;
      meet.t = x[p1] - x[p2];
      meet.p1 = p1;
      meet.p2 = p2;
    }
  }
  if (d[p1] == 'N' && d[p2] == 'W') {
    if (x[p1] > x[p2]) return;
    if (y[p1] > y[p2]) return;
    int disP1 = y[p2] - y[p1];
    int disP2 = x[p2] - x[p1];
    if (disP1 != disP2) return;
    M meet;
    meet.t = disP1;
    meet.p1 = p1;
    meet.p2 = p2;
    pq.push(meet);
  }
  if (d[p1] == 'N' && d[p2] == 'E') {
    if (x[p1] < x[p2]) return;
    if (y[p1] > y[p2]) return;
    int disP1 = y[p2] - y[p1];
    int disP2 = x[p1] - x[p2];
    if (disP1 != disP2) return;
    M meet;
    meet.t = disP1;
    meet.p1 = p1;
    meet.p2 = p2;
    pq.push(meet);
  }
  if (d[p1] == 'S' && d[p2] == 'E') {
    if (x[p1] < x[p2]) return;
    if (y[p1] < y[p2]) return;
    int disP1 = y[p1] - y[p2];
    int disP2 = x[p1] - x[p2];
    if (disP1 != disP2) return;
    M meet;
    meet.t = disP1;
    meet.p1 = p1;
    meet.p2 = p2;
    pq.push(meet);
  }
  if (d[p1] == 'S' && d[p2] == 'W') {
    if (x[p1] > x[p2]) return;
    if (y[p1] < y[p2]) return;
    int disP1 = y[p1] - y[p2];
    int disP2 = x[p2] - x[p1];
    if (disP1 != disP2) return;
    M meet;
    meet.t = disP1;
    meet.p1 = p1;
    meet.p2 = p2;
    pq.push(meet);
  }
}
int main() {
  cin >> z;
  for (int i = 0; i < z; i++) {
    cin >> x[i] >> y[i] >> d[i];
  }
  for (int i = 0; i < z; i++) {
    for (int x = 0; x < z; x++) {
      if (i == x) continue;
      fill(i, x);
    }
  }
  while (!pq.empty()) {
    if (!vanished[pq.top().p1] && !vanished[pq.top().p2]) {
      vanished[pq.top().p1] = true;
      vanished[pq.top().p2] = true;
    }
    pq.pop();
  }
  int count = 0;
  for (int i = 0; i < z; i++) {
    if (!vanished[i]) count++;
  }
  cout << count << endl;
  return 0;
}
