#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc, ans = 0;
  char str[20];
  cin >> tc;
  while (tc--) {
    cin >> str;
    if (strcmp(str, "Tetrahedron") == 0)
      ans += 4;
    else if (strcmp(str, "Cube") == 0)
      ans += 6;
    else if (strcmp(str, "Octahedron") == 0)
      ans += 8;
    else if (strcmp(str, "Dodecahedron") == 0)
      ans += 12;
    else if (strcmp(str, "Icosahedron") == 0)
      ans += 20;
  }
  cout << ans << endl;
}
