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