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