#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  string L = ".";
  L += S;
  string R = S;
  R += "#";
  bool b = false;
  int cntw = 0;
  for (int i = 0; i < N + 1; i++) {
    if (R[i] == '#') b = true;
    if (b && R[i] == '.') cntw++;
  }
  bool w = false;
  int cntb = 0;
  for (int i = N; i >= 0; i--) {
    if (L[i] == '.') w = true;
    if (w && L[i] == '#') cntb++;
  }
  cout << min(cntb, cntw) << endl;
  return 0;
}
