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