#include <bits/stdc++.h>
const int INF=1e9,MOD=1e9+7;
const long long LINF=1e18;
using namespace std;
#define int long long
//template
//main
signed main(){
  int N;string s;cin>>N>>s;
  std::vector<int> v(N+1,0);
  for(int i=0;i<N;i++)v[i+1]=v[i]+(s[i]=='#');
  int ans=LINF;
  for(int i=0;i<=N;i++)ans=min(ans,v[i]-v[0]+N-i-(v[N]-v[i]));
  cout<<ans<<endl;
}
