#include <bits/stdc++.h>
using namespace std;
int countdot(int start, int N, string S) {
  int c = 0;
  for (int i = start; i < N; i++) {
    if (S[i] == '.') {
      c++;
    }
  }
  return c;
}
int counts(int start, int N, string S) {
  int c = 0;
  for (int i = start; i < N; i++) {
    if (S[i] == '#') {
      c++;
    }
  }
  return c;
}
int main() {
  int N;
  string S;
  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 ans = N;
  int d = 0;
  bool flag = false;
  for (int x : index) {
    if (x != 0) {
      flag = true;
      ans = min(ans, d + countdot(x, N, S));
      d++;
    }
  }
  ans = min(d, ans);
  if (flag) {
    cout << ans << "\n";
  } else {
    cout << 0 << "\n";
  }
}
