#include <bits/stdc++.h>
using namespace std;
int main() {
  long int N;
  string S;
  cin >> N >> S;
  int B = 0;
  int W = 0;
  int countb = 0;
  int countw = 0;
  long int b = 0;
  long int w = N - 1;
  while (B == 0) {
    if (S.at(b) == '.') {
      b++;
      if (b == N - 1) {
        break;
      }
    } else {
      B++;
    }
  }
  while (W == 0) {
    if (S.at(w) == '#') {
      w--;
      if (w == 0) {
        break;
      }
    } else {
      W++;
    }
  }
  for (int i = b + 1; i < N; i++) {
    if (S.at(i) == '.') {
      countb++;
    }
  }
  for (int j = w - 1; j > -1; j--) {
    if (S.at(j) == '#') {
      countw++;
    }
  }
  cout << min(countb, countw);
}
