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