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