#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int a = 0;
  int b = n - 1;
  while (s.at(a) == '.' and a < n) {
    a++;
  }
  while (s.at(b) == '#' and b > 0) {
    b--;
  }
  int u = 0;
  int t = 0;
  for (int i = a; i <= b; i++) {
    if (s.at(i) == '#') {
      u++;
    } else {
      t++;
    }
  }
  cout << min(u, t) << endl;
}
