#include <bits/stdc++.h>
using namespace std;
struct $ {
  $() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
  }
} $;
const int N = 200005;
int main() {
  int n;
  cin >> n;
  int ans = 0;
  map<char, int> m;
  m['T'] = 4;
  m['C'] = 6;
  m['O'] = 8;
  m['D'] = 12;
  m['I'] = 20;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    ans += m[s[0]];
  }
  cout << ans << endl;
  return 0;
}
