#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, topcount, backcount, i;
  int blacknum, whitenum;
  blacknum = 0;
  cin >> N;
  whitenum = 0;
  topcount = N - 1;
  backcount = 0;
  string S;
  cin >> S;
  for (i = 0; i < N; i++) {
    if (S[i] == '#') {
      topcount = i;
      break;
    }
  }
  for (i = N - 1; i >= 0; i++) {
    if (S[i] == '.') {
      backcount = i;
      break;
    }
  }
  for (i = topcount; i <= backcount; i++) {
    if (S[i] == '#') {
      blacknum += 1;
    } else
      whitenum += 1;
  }
  cout << min(blacknum, whitenum);
  return 0;
}
