#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  string S;
  cin >> N >> S;
  reverse(S.begin(), S.end());
  int i = 0;
  for (; i < N; i++) {
    if (S.at(i) != '#') {
      break;
    }
  }
  int cnt_b = 0;
  int cnt_w = 0;
  for (; i < N; i++) {
    if (S.at(i) == '#') {
      cnt_b++;
    } else {
      cnt_w++;
    }
  }
  cout << min(cnt_b, cnt_w) << endl;
}
