#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int head_idx = s.find_first_of('#');
  int last_idx = s.find_last_of('.');
  int hc_w = 0;
  int hc_b = 0;
  for (int i = head_idx; i < s.length(); i++) {
    if (s[i] == '.')
      hc_w++;
    else
      hc_b++;
  }
  int lc_w = 0;
  int lc_b = 0;
  for (int i = last_idx; i >= 0; i--) {
    if (s[i] == '.')
      lc_w++;
    else
      lc_b++;
  }
  cout << min(min(hc_w, hc_b), min(lc_w, lc_b)) << endl;
  return 0;
}
