#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  int c, d;
  c = d = 0;
  int prev = s[0];
  for (int i = 1; i < n; i++) {
    if (prev == '#' && s[i] == '.') {
      ++c;
    } else {
      prev = s[i];
    }
  }
  prev = s[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    if (prev == '.' && s[i] == '#') {
      ++d;
    } else {
      prev = s[i];
    }
  }
  cout << min(c, d) << endl;
}
