#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
#define pb push_back
#define mp make_pair
#define F .first
#define S .second 
using ll=long long;
using ld=long double;
using namespace std;
const ll mod=1e9+7;
int main(){
  ll n,w=0,b=0,x=0,y=0;
  cin>>n;
  string s;
  cin>>s;
  irep(i,s.length()-1,0)if(s[i]=='#'){x=i;}
  irep(i,s.length(),x)if(s[i]=='.')w++;
  rep(i,0,s.length())if(s[i]=='.'){x=i;}
  rep(i,0,x+1)if(s[i]=='#')b++;
  cout<#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
#define pb push_back
#define mp make_pair
#define F .first
#define S .second 
using ll=long long;
using ld=long double;
using namespace std;
const ll mod=1e9+7;
int main(){
  ll n,w=0,b=0,x=0,y=0;
  cin>>n;
  string s;
  cin>>s;
  irep(i,s.length()-1,0)if(s[i]=='#'){x=i;}
  irep(i,s.length(),x)if(s[i]=='.')w++;
  rep(i,0,s.length())if(s[i]=='.'){x=i;}
  rep(i,0,x+1)if(s[i]=='#')b++;
  cout<<min(w,b);
}
<min(w,b);
}
