#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;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    if (c == '#') {
      flgb = 1;
      nowb++;
    }
    if (c == '.') {
      answ += nowb;
      nowb = 0;
      if (flgb) ansb++;
    }
  }
  int ans = min(ansb, answ);
  cout << ans << endl;
}
