fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int n;
  5. int main(){
  6. cin >> n;
  7. string s;
  8. int res=0;
  9. for (int i = 1; i <= n; i++){
  10. cin >> s;
  11. if (s[0]=='T') res += 4;
  12. if (s[0]=='C') res+=6;
  13. if (s[0]=='O') res+=8;
  14. if (s[0]=='D') res+=12;
  15. if (s[0]=='I') res+=20;
  16. }
  17. cout << res << endl;
  18. return 0;
  19. }
  20.  
  21.  
Success #stdin #stdout 0s 15240KB
stdin
4
Icosahedron
Cube
Tetrahedron
Dodecahedron
stdout
42