#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int ans = 0;
  int b = 0, w = 0;
  for (int i = 1; i < N; i++) {
    if (S.at(i) == '.') w++;
    if (S.at(i) == '#') b++;
    if (S.at(i) == '.' && S.at(i - 1) == '#') {
      if (b <= w) {
        S.at(i - 1) = '.';
        b = 0;
        w = 0;
        ans++;
      } else if (b > w) {
        S.at(i) = '#';
        b = 0;
        w = 0;
        ans++;
      }
    }
  }
  cout << ans << endl;
  cout << S << endl;
}
