#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char original_string[10000001];
int group_num[2][10000001];
int main() {
int n =0, temp_n =0,i = 0,temp_i = 0,j = 0,reduced_n = 0;
while(scanf("%d",&n)==1) {
temp_n = n;
i = 0,j = 0,temp_i=0;
scanf("%s",original_string);
for(i = 0; i<temp_n; ++i) {
while((j<temp_n-1)&&(original_string[j]==original_string[j+1])) {
++j;
}
group_num[0][i]=j;
group_num[1][i]=original_string[j];
if(j==temp_n) {
break;
}
temp_i = i;
++j;
}
reduced_n = (temp_i+1)*2;
if(reduced_n>=n) {
printf("%s\n",original_string);
} else {
printf("%d%c",group_num[0][0]+1,group_num[1][0]);
for(i = 1; group_num[1][i]!='\0'; ++i) {
printf("%d%c",group_num[0][i]-group_num[0][i-1],group_num[1][i]);
}
printf("\n");
}
}
return 0;
}