#include<bits/stdc++.h>
using namespace std;
string str[100];
int main()
{
long long k, x = 0;
cin >> k;
for (int i = 0; i < k; i++)
{
string n;
cin >> n;
bool b = 0;
for (int j = 0; j < x; j++)
{
if (str[j][0] == n[0] && str[j][1] == n[1])
{
b = 1;
break;
}
}
if (!b)
{
x++;
str[x] = n;
}
}
cout << 52 - x << endl;
return 0;
}