#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3F3F3F3F;
const long long LINF = 0x3F3F3F3F3F3F3F3F;
const long long MOD = 1e9 + 7;
int dy[] = {-1, 1, 0, 0, -1, 1, -1, 1};
int dx[] = {0, 0, -1, 1, -1, 1, 1, -1};
int main() {
  int n;
  char s[101];
  scanf("%d %s ", &n, s);
  for (int i = 0; i < n; ++i) {
    int k = 0;
    while (i < n && s[i] == '1') {
      k += (s[i++] - '0');
    }
    printf("%d", k);
  }
  if (s[n - 1] == '0') printf("0");
  return 0;
}
