#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int count_white, count_black, count_bw = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#') count_white++;
  }
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '.') count_black++;
  }
  for (int i = 0; i < count_black; i++) {
    if (S.at(i) == '#') count_bw++;
  }
  for (int i = count_black; i < N; i++) {
    if (S.at(i) == '.') count_bw++;
  }
  int tmp = min(count_white, count_black);
  int answer = min(count_bw, tmp);
  cout << answer << endl;
}
