#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  string S;
  cin >> N >> S;
  int black = 0;
  long long black_count = 0;
  long long all_count = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      black = 1;
      black_count += 1;
    }
    if ((black = 1) && (S[i] == '.')) {
      all_count += black_count;
      black_count = 0;
      black = 0;
    }
  }
  if (all_count > N / 2) {
    all_count = N - all_count;
  }
  cout << all_count;
}
