#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  string str;
  cin >> n >> str;
  long long i = 0;
  while (i < n) {
    long long j = i;
    long long cnt = 0;
    while (j < n && str[j] != '0') {
      j++;
      cnt++;
    }
    cout << cnt;
    i = j + 1;
  }
  if (str[n - 1] == '0') cout << 0;
  return 0;
}
