#include<iostream> #include<cstring> #include<cmath> using namespace std; char a[1002]; int b[1003]; int main() { cin>>a; for(int i=0;i<strlen(a);i++){ b[i]=int(a[i])-'0'; } b[strlen(a)]=int(a[strlen(a)-1])+1-'0'; int count=1; int curNum=a[0]-'0'; for(int i=0;i<strlen(a);i++){ if(a[i]-'0'==b[i+1]){ count++; } else{ cout<<count<<curNum; count=1; int maxNum=min(i+1,int(strlen(a)-1)); curNum=a[maxNum]-'0'; } } return 0; }