#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int c_w = 0;
  int c_b = 0;
  int idx = s.find_first_of('#');
  for (int i = idx; i < s.length(); i++) {
    if (s[i] == '.')
      c_w++;
    else
      c_b++;
  }
  cout << min(c_w, c_b) << endl;
  return 0;
}
