#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int b = 0, w = 0;
  vector<int> cnt_b, cnt_w;
  for (int i = (0); i < ((n)); i++) b += (s[i] == '#'), cnt_b.push_back(b);
  for (int i = (0); i < ((n)); i++)
    w += (s[n - i - 1] == '.'), cnt_w.push_back(w);
  reverse(cnt_w.begin(), cnt_w.end());
  int ans = INT_MAX;
  for (int i = (0); i < ((n)); i++) ans = min(ans, cnt_b[i] + cnt_w[i] - 1);
  for (int i = (0); i < ((n)); i++) cout << cnt_b[i] << ", ";
  cout << endl;
  for (int i = (0); i < ((n)); i++) cout << cnt_w[i] << ", ";
  cout << endl;
  cout << ans << endl;
}
