#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int f = 0, b, c = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#' && f == 0) {
      f = 1;
    }
    if (f == 1 && s[i] == '.') {
      c++;
    }
  }
  reverse(s.begin(), s.end());
  f = 0;
  int d = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '.' && f == 0) {
      f = 1;
    }
    if (f == 1 && s[i] == '#') {
      d++;
    }
  }
  cout << min(c, d);
  return 0;
}
