#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, l;
  scanf("%d", &l);
  ;
  string s;
  cin >> s;
  int v = 0, r = 0;
  for (auto it : s) {
    if (it == '0')
      v = v * 10 + r, r = 0;
    else
      r++;
  }
  v = v * 10 + r;
  printf("%d", v);
}
