#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  const char* x = s.c_str();
  int cnt = 0;
  int j = 0;
  for (int i = 0; i < n; i++) {
    if (x[i] == '#' && j == 0) j = 1;
    if (x[i] == '.' && j == 1) cnt++;
  }
  if (j == 0)
    cout << cnt << endl;
  else
    cout << min(cnt, n - cnt) << endl;
}
