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