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