#include <stdio.h> int main() { char line[30]; int n; scanf("%d", &n); getchar(); int ans=0; while(n--) { scanf("%s", line); if(line[0]=='T') ans+=4; else if(line[0]=='C') ans+=6; else if(line[0]=='O') ans+=8; else if(line[0]=='D') ans+=12; else if(line[0]=='I') ans+=20; } printf("%d\n", ans); return 0; }