#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j = 0, k, l, n, ar[19990] = {0}, tur[100000], a = 0, b = 0,
                   c = 0;
  char tr[1000], x, pr[1000], ax[] = {"ab"}, bx[] = {"ab"};
  map<string, string> leaf;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> tr >> pr;
    if (strcmp(tr, bx) == 0)
      if (strcmp(pr, ax) == 0) {
        cout << 2;
        return 0;
      }
    strcat(tr, pr);
    leaf.insert(pair<string, string>(tr, pr));
  }
  cout << leaf.size();
}
