#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  int cnt = 0, first_b = 0;
  int ans = 0;
  cin >> N >> S;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      first_b = i;
      break;
    }
  }
  for (int i = first_b; i < N; i++) {
    if (S[i] == '.') {
      cnt++;
    }
  }
  cout << min(cnt, N - first_b - cnt) << endl;
  return 0;
}
