#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  long long ans = 0;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    if (s == "Tetrahedron") ans += 4;
    if (s == "Cube") ans += 6;
    if (s == "Octahedron") ans += 8;
    if (s == "Dodecahedron") ans += 12;
    if (s == "Icosahedron") ans += 20;
  }
  cout << ans;
}
