#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string S;
  cin >> N;
  cin >> S;
  int wc = 0, bc = 0, bwc = 0, counter = 0;
  bool isBlack = false, isWhite = false;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      wc++;
    }
    if (isBlack && S[i] == '.') {
      bwc++;
      isWhite = true;
    }
    if (S[i] == '#') {
      if (isWhite) {
        isWhite = false;
        if (wc > bc) {
          bwc = 0;
          counter += bc;
        }
        bc = 0;
      }
      bc++;
      isBlack = true;
    }
  }
  if (bwc > bc)
    counter += bc;
  else
    counter += bwc;
  cout << counter << endl;
  return 0;
}
