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