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