#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, sum = 0;
  string tmp;
  cin >> n;
  while (n--) {
    cin >> tmp;
    if (tmp == "Icosahedron")
      sum += 20;
    else if (tmp == "Tetrahedron")
      sum += 4;
    else if (tmp == "Cube")
      sum += 6;
    else if (tmp == "Octahedron")
      sum += 8;
    else
      sum += 12;
  }
  cout << sum << '\n';
  return 0;
}
