import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException;
public class Main{ public static void main(String[] args)throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String str = in.readLine(); StringBuilder s = new StringBuilder(); char ch; int sum = 1; int len = str.length(); ch = str.charAt(0); for(int i = 1;i < len;i ++){ if(ch == str.charAt(i)){ sum ++; }else{ s.append(sum); s.append(ch); ch = str.charAt(i); sum = 1; }
}
s.append(sum);
s.append(ch);
System.out.println(s.toString());
}
}