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