#include<bits/stdc++.h>
using namespace std;

int main() {
  int N; string S; cin >> N >> S;
  int a = 0, b = 0;
  for( int i = 0; i < N; i++ ) {
    if( S.at(i) == '.' )
      b++;
  }
  a = b;
  for( int i = 0; i < N; i++ ) {
    if( S.at(i) == '.' )
      b--;
    else
      b++;
    a = min(a,b);
  }
  cout << a << endl;
}