#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int start = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == '#') {
      start = i;
      break;
    }
  }
  int ans_b = 0;
  for (int i = start + 1; i < S.size(); i++) {
    if (S[i] == '.') ans_b++;
  }
  int ans_w = 0;
  for (int i = start; i < S.size() - 1; i++) {
    if (S[i] == '#') ans_w++;
  }
  if (ans_b <= ans_w)
    cout << ans_b << endl;
  else
    cout << ans_w << endl;
  return 0;
}
