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