#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  string S;
  cin >> N >> S;
  int pat1 = 0;
  int pat2 = 0;
  int pat3 = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S.at(i) == '.') {
      pat1++;
    } else {
      pat2++;
      pat3++;
    }
  }
  if (S.at(S.size() - 1) == '#') {
    pat3--;
  }
  cout << min(pat1, (min(pat2, pat3))) << endl;
}
