#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S, Target, U = "#";
  int counter = 0, bapp = 0, yapp = 0, t = 0;
  cin >> N;
  cin >> S;
  Target = S;
  for (size_t i = 0; i < S.size(); i++) {
    if (S.at(i) == '.') {
      if (bapp != 0) {
        yapp++;
      }
    } else {
      bapp++;
    }
  }
  while (U == S.substr(S.size() - t, t)) {
    t++;
    bapp--;
    U += "#";
  }
  cout << min(bapp, yapp);
}
