#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char c;
  for (int i = 0; i < n; i++) {
    int num = 0;
    cin >> c;
    while (c != '0' && i < n) {
      num++;
      cin >> c;
      i++;
    }
    cout << num;
    num = 0;
  }
  if (c == '0') cout << '0';
  return 0;
}
