#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count = 0;
  cin >> n;
  getchar();
  char a[100];
  for (int i = 1; i <= n; i++) {
    gets(a);
    if (strcmp(a, "Tetrahedron") == 0)
      count += 4;
    else if (strcmp(a, "Cube") == 0)
      count += 6;
    else if (strcmp(a, "Octahedron") == 0)
      count += 8;
    else if (strcmp(a, "Dodecahedron") == 0)
      count += 12;
    else
      count += 20;
  }
  cout << count;
  return 0;
}
