#include <bits/stdc++.h>
using namespace std;
int lens, ans = 0;
char s[110];
int main() {
  scanf("%d", &lens);
  scanf("%s", s + 1);
  s[++lens] = 0;
  for (int i = 1; i <= lens; i++) {
    if (s[i] == '1')
      ans++;
    else {
      printf("%d", ans);
      ans = 0;
    }
  }
}
