#include <bits/stdc++.h>
using namespace std;
const int N = 2000000 + 500;
const int MAXN = 10000 + 1;
long long ans;
int main() {
  ios_base::sync_with_stdio(false);
  int n, c = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '0') {
      cout << c;
      c = 0;
    } else
      c++;
  }
  cout << c;
  return 0;
}
