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