#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  string s;
  cin >> n >> s;
  vector<int> aa;
  aa.push_back(-1);
  for (int i = (0); i < (n); i++) {
    if (s[i] == '0') aa.push_back(i);
  }
  aa.push_back(n);
  for (int i = (1); i < (aa.size()); i++) {
    cout << aa[i] - aa[i - 1] - 1;
  }
  cout << endl;
}
