#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:1000000000")
long long gr(string &s) {
  if (s == "Icosahedron") return 20;
  if (s == "Dodecahedron") return 12;
  if (s == "Octahedron") return 8;
  if (s == "Tetrahedron") return 4;
  if (s == "Cube") return 6;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  string st;
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    cin >> st;
    ans += (long long)gr(st);
  }
  cout << ans;
}
