#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long n;
  long count = 0;
  cin >> n;
  vector<char> s(n);
  for (int j = 0; j < n; j++) {
    cin >> s[j];
  }
  for (long i = 0; i < n; i++) {
    if (s[i] == '#') count++;
  }
  long ans = count < (n - count) ? count : (n - count);
  if (s[0] == '.' && ans != 0) ans--;
  if (s[n - 1] == '#' && ans != 0) ans--;
  cout << ans;
  return 0;
}
