#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
using namespace std;
#define MAX 1000000007
typedef long long ll;

int main(){
  ll count=0,B[210000],W[210000];
  int N,S;
  cin>>N>>S;
  B[0]=0;

  for(int i=0;i<N;i++){
    if(i!=0) B[i]=count;
    if(S[i]=='#') count++;
  }
  count=0;

  for(int i=N-1;i>=0;i--){
    if(S[i]=='.') count++;
    W[i]=count;
  }
  ll ans=210000;
  for(int i=0;i<N;i++){
    ans=min(ans,B[i]+W[i]);
  }
  cout<<ans<<endl;
}

