#include<iostream>; using namespace std; int main() { //string a, b, c, d, e; int score=0; string s; cin>>s; if(s[0]=='D'){ score+=30; } if(s[1]=='C'){ score+=30; } if(s[2]=='B'){ score+=30; } if(s[3]=='A'){ score+=30; } if(s[4]=='D'){ score+=30; } else{ score+=0; } cout<<sum; return 0; }