#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int idx = -1;
  for (int i = 0; i < N; ++i) {
    if (S[i] == '#' && idx == -1) {
      idx = i;
    }
    if (S[i] == '.') {
      idx = -1;
    }
  }
  int end = (idx >= 0 ? idx : N - 1);
  int allBlack = (S[end] == '#' ? 0 : 1);
  int allWhite = (S[end] == '.' ? 0 : 1);
  int onlyOneBlack = (S[end] == '#' ? 0 : 1);
  for (int i = 0; i < end; ++i) {
    if (S[i] == '.') {
      allBlack++;
    } else {
      onlyOneBlack++;
      allWhite++;
    }
  }
  int ans = min(allBlack, allWhite);
  cout << min(ans, onlyOneBlack) << endl;
  return 0;
}
