#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int cnt = 0, temp;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      temp = i;
      while (i < n) {
        if (s[i] == '.') cnt++;
        i++;
      }
    }
  }
  cout << min(n - temp - cnt, cnt) << endl;
}
