#include <bits/stdc++.h>
int main() {
  int n, a = 0, cnt = 0;
  int b[95];
  int c[95];
  char s[95];
  scanf("%d", &n);
  scanf("%s", s);
  for (int i = 0; i < n; i++) {
    b[i] = s[i] - 48;
  }
  b[n] = 0;
  for (int i = 0; i <= n; i++) {
    if (cnt == 0) {
      if (b[i] == 0) {
        c[0] = i;
        a = i;
        cnt++;
        continue;
      }
    }
    if (b[i] == 0) {
      c[cnt] = i - a - 1;
      a = i;
      cnt++;
    }
  }
  for (int j = 0; j < cnt; j++) {
    printf("%d", c[j]);
  }
}
