#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int cnt_sharp, cnt_dot;
  cnt_sharp = 0;
  cnt_dot = 0;
  int j = 1;
  string S_ori = S;
  int loop = N - 1;
  while (S[N - j] == '#') {
    j++;
  }
  loop -= (j - 1);
  for (int i = loop; i >= 0; i--) {
    if (S[i] == '.') {
      cnt_dot++;
    } else {
      cnt_sharp++;
    }
  }
  cout << min(cnt_dot, cnt_sharp) << endl;
}
