#include <iostream>
#include <unordered_map>
using namespace std;
int a[100];
unordered_map <char, int> point{
{'A', 1},
{'2', 2},
{'3', 3},
{'4', 4},
{'5', 5},
{'6', 6},
{'7', 7},
{'8', 8},
{'9', 9},
{'T', 10},
{'J', 11},
{'Q', 12},
{'K', 13}
};
unordered_map <char, int> color{
{'D', 1},
{'C', 3},
{'H', 5},
{'S', 7}
};
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
int res = 52;
for(int i = 0; i < n; i++){
char op1, op2;
cin >> op1 >> op2;
int x = color[op1], y = point[op2];
a[x * 10 + y] ++;
if(a[x * 10 + y] < 2) res --;
}
cout << res << endl;
return 0;
}