#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int c = 0;
  cin >> n;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s == "Tetrahedron") c = c + 4;
    if (s == "Cube") c = c + 6;
    if (s == "Octahedron") c = c + 8;
    if (s == "Dodecahedron") c = c + 12;
    if (s == "Icosahedron") c = c + 20;
  }
  cout << c;
  return 0;
}
