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