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