#include <bits/stdc++.h>
using namespace std;
int mod3(int N, int M) {}
int main() {
  int N;
  cin >> N;
  char S[200000];
  cin >> S;
  int count = 0;
  bool cle = true;
  int i;
  while (cle) {
    cle = false;
    for (i = 0; S[i + 1]; i++) {
      if (S[i] == '#' && S[i + 1] == '.') {
        S[i] = '.';
        count++;
        cle = true;
      }
    }
  }
  for (i = 0; S[i]; i++) cout << S[i];
  cout << "\n" << count;
}
