#include <bits/stdc++.h>
using namespace std;
int n, r = -1, mc = 0, counts = 0;
bool flag;
string s;
vector<int> a(400000);
vector<int> b(400000);
vector<int> c(400000);
int main() {
  cin >> n >> s;
  a.at(0) = 0;
  for (int i = 1; i < n + 1; ++i) {
    int d;
    d = (s.at(i - 1) == '#') ? 1 : 0;
    a.at(i) = a.at(i - 1) + d;
  }
  b.at(n) = 0;
  for (int i = n - 1; i >= 0; --i) {
    int d;
    d = (s.at(i) == '.') ? 1 : 0;
    b.at(i) = b.at(i + 1) + d;
  }
  int mins = 10000000;
  for (int i = 0; i < n; ++i) {
    mins = min(mins, a.at(i) + b.at(i));
  }
  for (int i = 0; i <= n; ++i) cout << a.at(i);
  cout << endl;
  for (int i = 0; i <= n; ++i) cout << b.at(i);
  cout << endl;
  cout << mins << endl;
}
