#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int *w, *b;
  w = new int[N + 1];
  b = new int[N + 1];
  int ans = N;
  int cntw = 0, cntb = 0;
  for (int i = 1; i <= N; i++) {
    if (S[i - 1] == '#') cntb++;
    if (S[i - 1] == '.') cntw++;
    b[i] = cntb;
    w[i] = cntw;
  }
  for (int i = 0; i < N + 1; i++) {
    ans = min(ans, b[i] + w[N] - w[i]);
  }
  cout << ans << endl;
  return 0;
}
