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

int main(){
  int N;
  string S;
  cin >> N >> S;
  vector<int> B(N+10),W(N+10);
  B[0]=0;
  for(int i=0;i<N;i++){
    B[i+1]=B[i]; if(S[i]=='#'){B[i+1]++;}
  }
  for(int i=0;i<=N;i++){W[i]=i-B[i];}
  int m=200000000;
  for(int i=0;i<N;i++){
    int a=B[i]+(W[N]-W[i+1]);
    m=min(a,m);
  }
  cout << m << endl;
}