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