#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int flag, N, m;
  string S;
  int left[200010] = {0}, right[200010] = {0};
  cin >> N >> S;
  for (int i = 1; i <= N; i++) {
    if (S[i - 1] == '#') left[i]++;
    left[i] += left[i - 1];
  }
  for (int i = N - 1; i >= 0; i--) {
    if (S[i] == '.') right[i]++;
    if (i < N - 1) right[i] += right[i + 1];
  }
  for (int i = 0; i <= N; i++) cout << left[i] << " ";
  cout << endl;
  for (int i = 0; i <= N; i++) cout << right[i] << " ";
  cout << endl;
  m = 200010;
  for (int i = 0; i <= N; i++) {
    m = min(m, left[i] + right[i]);
  }
  cout << m << endl;
  return 0;
}
