#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  string S;
  cin >> N >> S;
  int cntSharp = 0, cntDot = 0;
  for (char c : S) {
    if (cntSharp == 0 && c == '.') {
      continue;
    }
    c == '#' ? cntSharp++ : cntDot++;
  }
  cout << ((cntSharp < cntDot) ? cntSharp : cntDot);
}
