#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int count1 = 0;
  int state = 0;
  int count2 = 0;
  int count3 = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      state = 1;
    }
    if (state == 1) {
      if (S[i] == '.') {
        count1++;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      count2++;
    }
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      count3++;
    }
  }
  cout << min(count1, min(count3, count2)) << endl;
}
