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