#include <bits/stdc++.h>
using namespace std;
const long long N = 1025, M = 11;
long long n, cnt;
string s;
vector<long long> ans;
int32_t main() {
  cin >> n >> s;
  s += '0';
  for (long long i = 0; i <= n; i++) {
    if (s[i] == '1')
      cnt++;
    else {
      cout << cnt;
      cnt = 0;
    }
  }
  return 0;
}
