#include <bits/stdc++.h>
using namespace std;
const double pi = atan(1.0) * 4.0;
const long long int mod = 1e9 + 7;
const long long int INF = 1e18;
int main() {
  int t;
  string str;
  cin >> t;
  int ans = 0;
  for (int j = 1; j <= t; j++) {
    cin >> str;
    if (str[0] == 'T') ans += 4;
    if (str[0] == 'C') ans += 6;
    if (str[0] == 'O') ans += 8;
    if (str[0] == 'I') ans += 20;
    if (str[0] == 'D') ans += 12;
  }
  cout << ans << endl;
  return 0;
}
