#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define bug cout<<"AIkahne aise"<<endl
ll A[5000001];
vector<ll>v;
vector<pair<ll,ll> >v2;
/void sieve()
{
    for(ll i=3; i<=2000; i+=2)
    {
        for(ll j=ii; j<=4000000; j+=i)
            A[j]=1;
    }
    v.push_back(2);
    for(ll i=3; i<=4000000; i+=2)
        if(A[i]==0)
            v.push_back(i);
}*/
int main()
{
    ll n,k,white=0,black=0,ans=9999999999,nblack=0,nwhite=0;
 string s;
 cin>>n;
 cin>>s;
  for(int i=0;i<s.size();i++)
 {
     if(s[i]=='#')
        black++;
     else
        white++;
 
 }
 ans=white;
  for(int i=0;i<s.size();i++)
  {
      if(s[i]=='#')
        nblack++;
      else
        nwhite++;
      ans=min(ans,nblack+white-nwhite);
  }
  cout<<ans<<endl;
return 0;
}