#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  string s;
  int n;
  cin >> n;
  cin >> s;
  int y = 0;
  bool checker = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '0') {
      cout << y;
      y = 0;
    } else
      y++;
  }
  cout << y;
}
