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