#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
using ll=long long;
int main(){
  ll n,w=0,b=0,x=0;
  cin>>n;
  string s;
  cin>>s;
  rep(i,0,s.length())if(s[i]=='#')x=i;
  rep(i,0,x+1)if(s[i]=='#')w++;
  rep(i,0,s.length())if(s[i]=='.')b++;
  cout<<min(w,b);
}
