#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int p = 0;
  for (int i = 0; i < N; i++) {
    if (i == 0 && S[i] == '.') {
      while (i < N && S[i] == '.') {
        i++;
      }
      p = i;
      i--;
    }
  }
  int countA = 0;
  for (int i = p; i < N; i++) {
    if (S[i] == '#') countA++;
  }
  int countB = 0;
  for (int i = p; i < N; i++) {
    if (S[i] == '.') countB++;
  }
  cout << min(countA, countB) << endl;
}
