#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  string S;
  cin >> N >> S;
  int all_bnum = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      all_bnum++;
    }
  }
  int all_wnum = N - all_bnum;
  int ans = N;
  int bnum = 0, wnum = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      bnum++;
    } else {
      wnum++;
    }
    ans = min(ans, bnum + (all_wnum - wnum));
  }
  cout << ans << endl;
  return 0;
}
