#include <bits/stdc++.h>
int main(int ac, char **av) {
  int n;
  int res = 0;
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    std::string a;
    std::cin >> a;
    if (a.compare("Tetrahedron") == 0)
      res += 4;
    else if (a.compare("Cube") == 0)
      res += 6;
    else if (a.compare("Octahedron") == 0)
      res += 8;
    else if (a.compare("Dodecahedron") == 0)
      res += 12;
    else
      res += 20;
  }
  std::cout << res;
  return 0;
}
