#include <bits/stdc++.h>
using namespace std;
int min(int a, int b) {
  if (a > b) {
    return b;
  }
  return a;
}
int max(int a, int b) {
  if (a > b) {
    return a;
  }
  return b;
}
int abs(int a) {
  if (a > 0) {
    return a;
  }
  return -a;
}
int binsearch(vector<int> &h, int low, int high, int key) {
  if (low < high) {
    int mid = (low + high) / 2;
    if (h[mid + 1] >= key && h[mid] < key) {
      return mid;
    } else if (h[mid] >= key) {
      return binsearch(h, low, mid - 1, key);
    } else {
      return binsearch(h, mid + 1, high, key);
    }
  } else {
    int x = min(low, high);
    if (h[x] < key) {
      return x;
    }
    return x - 1;
  }
}
int hcf(int a, int b) {
  if (a == 1 || b == 1) {
    return 1;
  } else {
    if (b > a) {
      return hcf(b, a);
    } else {
      if (a % b == 0) {
        return b;
      }
      return hcf(b, a % b);
    }
  }
}
int main() {
  int n;
  cin >> n;
  string s;
  int ans = 0;
  while (n--) {
    cin >> s;
    if (s == "Tetrahedron") {
      ans += 4;
    } else if (s == "Cube") {
      ans += 6;
    } else if (s == "Octahedron") {
      ans += 8;
    } else if (s == "Dodecahedron") {
      ans += 12;
    } else {
      ans += 20;
    }
  }
  cout << ans;
}
