test case 3 is not passing
#include
using namespace std;
#include
int main() {
string s1;
getline(cin,s1);
string ans="";
int i=0;
int j=0;
while(i<s1.length()){
while(j<s1.length() && s1[i]==s1[j]){
j++;
}
int count=j-i;
ans=ans+s1[i]+char(count+'0');
i=j;
}
s1=ans;
cout<<s1<<endl;
return 0;
}