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