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