#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const double pi = acos(-1);
struct sx {};
bool cmp() {}
long long t1, t2, t3, t4, t5, t6;
bool c;
int main() {
  vector<int> v;
  string s;
  int n;
  cin >> n >> s;
  v.push_back(0);
  for (int i = 1; i <= n; i++)
    if (s[i - 1] == '0') v.push_back(i);
  v.push_back(n + 1);
  for (int i = 1; i < v.size(); i++) cout << v[i] - v[i - 1] - 1;
}
