#include <iostream>
#include <algorithm>
using namespace std;
int main() {
  long int N, cnt = 0, m = 0;
  long int lb = 0, lw = 0, rb = 0, rw = 0;
  string S;
  cin >> N >> S;
  //wb
  for(int i = 0; i < N; ++i)
    if(S[i] == '.') ++rw;
    else ++rb;
  m = min(rw, rb);
  for(int j = 0; j < N + 1; ++j) {
    if(S[j] == '.') {--rw; ++lw;}
    else {--rb; ++lb;}
    m = min(m, lb + rw);
  }
  cout << m << endl;
  return 0;
}
