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