#include <iostream>
#include <string>
using namespace std;
// 字符串统计
int main()
{
string text;
string line;
int rows=0;
while(getline(cin,line)){
if(line=="q"){
break;
}
text += line + "\n";
rows++;
}
cout<<"Total Chars:"<<text.size()<<" Total Rows:"<<rows<<endl;
cout<<text<<endl;
return 0;
}