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