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