#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  int nn = 0;
  int ans = 10000000;
  vector<int> black(N);
  vector<int> white(N);
  cin >> N >> S;
  if (S.at(0) == '#') {
    black.at(0) = 1;
  } else {
    black.at(0) = 0;
  }
  for (int i = 1; i < N; i++) {
    if (S.at(i) == '#') {
      black.at(i) = black.at(i - 1) + 1;
    } else {
      black.at(i) = black.at(i - 1);
    }
  }
  if (S.at(N - 1) == '.') {
    white.at(N - 1) = 1;
  } else {
    white.at(N - 1) = 0;
  }
  for (int i = (N - 2); i >= 0; i--) {
    if (S.at(i) == '.') {
      white.at(i) = white.at(i + 1) + 1;
    } else {
      white.at(i) = white.at(i + 1);
    }
  }
  for (int i = 0; i < (N - 1); i++) {
    if ((S.at(i) == '.') & (S.at(i + 1) == '#')) {
      int aa;
      aa = black.at(i) + white.at(i + 1);
      ans = min(ans, aa);
      nn++;
    }
  }
  if (nn == 0) {
    cout << "0" << endl;
  } else {
    cout << ans << endl;
  }
}
