#include <bits/stdc++.h>
using namespace std;
int s[300000];
int main() {
  s['T'] = 4;
  s['C'] = 6;
  s['O'] = 8;
  s['D'] = 12;
  s['I'] = 20;
  int n, sum = 0;
  string s1;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s1;
    sum += s[s1[0]];
  }
  cout << sum << endl;
  return 0;
}
