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