#include <bits/stdc++.h>
using namespace std;
int main() {
  long N;
  cin >> N;
  string S;
  cin >> S;
  long count_white = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == '.') count_white++;
  }
  long count_black = 0;
  long count_min = 9999999;
  for (long borderline = 0; borderline < S.size(); borderline++) {
    if (S[borderline] == '.') {
      count_white--;
    } else if (S[borderline] == '#') {
      count_black++;
    }
    if (count_min > (count_white + count_black)) {
      count_min = count_white + count_black;
    }
  }
  cout << count_min << endl;
}
