fork download
  1. #include <iostream>
  2. #include<string>
  3. #include<set>
  4. using namespace std;
  5.  
  6. int main() {
  7. long n;
  8. long count=0;
  9. string c;
  10. cin>>n;
  11. while(n>0){
  12. cin>>c;
  13. if(c[0]=='T') count+=4;
  14. else if(c[0]=='I') count+=20;
  15. else if(c[0]=='C') count+=6;
  16. else if(c[0]=='O') count+=8;
  17. else count+=12;
  18. n--;
  19. }
  20. cout<<count;
  21. return 0;
  22. }
Success #stdin #stdout 0s 5272KB
stdin
3
Dodecahedron
Octahedron
Octahedron
stdout
28