include[HTML_REMOVED]
using namespace std;
int main(){
int all;
int total = 0;
int tc = 0;
int tr = 0;
int tf = 0;
cin >> all;
for(int i = 1; i <= all; i++){
int num;
string what;
cin >> num >> what;
total += num;
if(what == "C"){
tc += num;
}
if(what == "R"){
tr += num;
}
if(what == "F"){
tf += num;
}
}
double pc = tc;
double pr = tr;
double pf = tf;
cout << "Total: " << total << " animals"<< endl;
cout << "Total coneys: " << tc << endl;
cout << "Total rats: " << tr << endl;
cout << "Total frogs: " << tf << endl;
printf("Percentage of coneys: %.2lf %%\n", pc/total*100);
printf("Percentage of rats: %.2lf %%\n", pr/total*100);
printf("Percentage of frogs: %.2lf %%\n", pf/total*100);
return 0;
}