#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, ans = 0, tmp, flg = 0, cntb = 0, cntw = 0, cntb1 = 0, flg_ = 0;
  string s;
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#' && flg == 0) {
      tmp = i;
      flg = 1;
    }
    if (s[i] == '#' && flg_ == 0) cntb1++;
    if (s[i] == '#') cntb++;
    if (s[i] == '.') {
      cntw++;
      flg_ = 1;
    }
  }
  for (int j = tmp; j < n; j++) {
    if (s[j] == '.') ans++;
  }
  ans = min(ans, cntb);
  ans = min(ans, cntw);
  ans = min(ans, cntb1);
  cout << ans << endl;
  return 0;
}
