#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  int n, cnt = 0;
  cin >> n;
  while (n--) {
    cin >> s;
    switch (s[0]) {
      case 'T': {
        cnt += 4;
        break;
      }
      case 'C': {
        cnt += 6;
        break;
      }
      case 'O': {
        cnt += 8;
        break;
      }
      case 'D': {
        cnt += 12;
        break;
      }
      case 'I': {
        cnt += 20;
        break;
      }
    }
  }
  cout << cnt << endl;
  return 0;
}
