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