#include <iostream>
#include<string>
#include<set>
using namespace std;
int main() {
long n;
long count=0;
string c;
cin>>n;
while(n>0){
cin>>c;
if(c[0]=='T') count+=4;
else if(c[0]=='I') count+=20;
else if(c[0]=='C') count+=6;
else if(c[0]=='O') count+=8;
else count+=12;
n--;
}
cout<<count;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZTxzdHJpbmc+CiNpbmNsdWRlPHNldD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewogICAgbG9uZyBuOwogICAgbG9uZyBjb3VudD0wOwogICAgc3RyaW5nIGM7CiAgICBjaW4+Pm47CiAgICB3aGlsZShuPjApewogICAgICAgIGNpbj4+YzsKICAgICAgICBpZihjWzBdPT0nVCcpIGNvdW50Kz00OwogICAgICAgIGVsc2UgaWYoY1swXT09J0knKSBjb3VudCs9MjA7CiAgICAgICAgZWxzZSBpZihjWzBdPT0nQycpIGNvdW50Kz02OwogICAgICAgIGVsc2UgaWYoY1swXT09J08nKSBjb3VudCs9ODsKICAgICAgICBlbHNlIGNvdW50Kz0xMjsKICAgICAgICBuLS07CiAgICB9CiAgICBjb3V0PDxjb3VudDsKICAgIHJldHVybiAwOwp9