#include <bits/stdc++.h>
using namespace std;
template <typename T>
void printVec(vector<T> &v) {
  for (long long i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << endl;
}
signed main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  vector<long long> v(n + 1, 0);
  for (long long i = 0; i < n; i++) {
    if (s[i] == '.')
      v[i + 1] = v[i] + 1;
    else
      v[i + 1] = v[i];
  }
  long long ans = 1000000000000;
  for (long long i = 0; i < n + 1; i++) {
    ans = min(ans, i - v[i] + (v[n] - v[i]));
  }
  printVec(v);
  cout << ans << endl;
  return 0;
}
