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