#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int FB = -1;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      FB = i;
      break;
    }
  }
  if (FB == -1) {
    cout << 0 << endl;
    return 0;
  }
  int WtB = 0;
  for (int i = FB; i < N; i++) {
    if (S[i] == '.') {
      WtB++;
    }
  }
  int LB = -1;
  for (int i = N - 1; i >= 0; i--) {
    if (S[i] == '.') {
      LB = i;
      break;
    }
  }
  if (LB == -1) {
    cout << 0 << endl;
    return 0;
  }
  int BtW = 0;
  for (int i = LB; i >= 0; i--) {
    if (S[i] == '#') {
      BtW++;
    }
  }
  cout << min(WtB, BtW) << endl;
  return 0;
}
