#include<bits/stdc++.h>
using namespace std;
int ans=52,m,n,k,l;
string s;
char c[53];
int main(){
cin>>m;
for(int i=1;i<=m;i++){
cin>>s;
if(s[0]=='D'){
k=1;
}else if(s[0]=='C'){
k=2;
}else if(s[0]=='H'){
k=3;
}else{
k=0;
}
if(s[1]=='A'){
k=k*13+1;
}else if(s[1]=='T'){
k=k*13+10;
}else if(s[1]=='J'){
k=k*13+11;
}else if(s[1]=='Q'){
k=k*13+12;
}else if(s[1]=='K'){
k=k*13+13;
}else{
k=k*13+(s[1]-'0');
}
if(c[k]==char(k+48)){
ans=ans;
}else{
ans--;
c[k]=char(k+48);
}
}
cout<<ans;
}
/**************************************************************
Problem: 2409
User: zhengzihao
Language: C++
Result: Accepted
Time:32 ms
Memory:2076 kb
****************************************************************/