#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int flgb = 0;
  int ansb = 0;
  int nowb = 0;
  int answ = 0;
  int b = 0;
  int w = 0;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    if (c == '#') {
      if (i <= n / 2) b++;
      flgb = 1;
      nowb++;
    } else {
      if (i >= n / 2) w++;
      answ += nowb;
      nowb = 0;
      if (flgb) ansb++;
    }
  }
  int ans = min({ansb, answ, b + w});
  cout << ans << endl;
}
