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