include[HTML_REMOVED]
using namespace std;
char x,y;
int n,a[5][55],s,sum;
int main(){
cin>>n;
while(n--)
{
cin>>x>>y;
s=y-'0';
if(y=='A') s=1;
if(y=='T') s=10;
if(y=='J') s=11;
if(y=='Q') s=12;
if(y=='K') s=13;
if(x=='D') a[1][s]=1;
if(x=='C') a[2][s]=1;
if(x=='H') a[3][s]=1;
if(x=='S') a[4][s]=1;
}
for(int i=1;i<=4;i++)
for(int j=1;j<=52;j++)
sum+=a[i][j];
cout<<52-sum;
return 0;
}