#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int black = 0, white = 0, ans = 0;
  while (!S.empty() && S.front() != '#') {
    S.erase(S.begin());
  }
  while (!S.empty() && S.back() != '.') {
    S.pop_back();
  }
  for (int i = 0; i < S.size(); i++) {
    (S[i] == '#') ? black++ : white++;
  }
  cout << min(black, white) << endl;
}
