#include <bits/stdc++.h>
using namespace std;
int main() {
  long long count = 0, B[210000], W[210000];
  long long N;
  string S;
  cin >> N >> S;
  B[0] = 0;
  for (int i = 0; i < N; i++) {
    if (i != 0) B[i] = count;
    if (S[i] == '#') count++;
  }
  count = 0;
  for (int i = N - 1; i >= 0; i--) {
    if (S[i] == '.') count++;
    W[i] = count;
  }
  long long ans = 210000;
  for (int i = 0; i < N; i++) {
    ans = min(ans, B[i] + W[i]);
  }
  if (B[N - 1] == N || W[0] == N) ans = 0;
  cout << ans << endl;
}
