#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  bool flag = false;
  ;
  cin >> N >> S;
  int index[N];
  for (int i = 0; i < N; i++) {
    index[i] = 0;
  }
  int c = 0;
  while (c < N) {
    if (S[c] == '#') {
      index[c] = c;
    }
    c++;
  }
  int counter = 0;
  int c2 = 0;
  int ans = N;
  for (int x : index) {
    if (x != 0) {
      flag = true;
      c2++;
      for (int i = x; i < N; i++) {
        if (S[i] == '.') {
          counter++;
        }
      }
      ans = min(counter, ans);
      counter = c2;
    }
  }
  if (flag) {
    cout << min(ans, counter) << '\n';
  } else {
    cout << 0 << '\n';
  }
}
