#include<bits/stdc++.h>
using namespace std;
#define int long long
#define itn int
#define fi first
#define se second
#define be begin()
#define en end()
#define reverse
const int mod=1000000007;
const int INFi=2147483647;
const long long INFl=9223372036854775807LL;
template<typename T> T abs(T a,T b){
  return max(a,b)-min(a,b);
}
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,ans=0;
  string s;
  cin>>n>>s;
  for(int i=0;i<s.size();i++){
    if(s[i]=='#') ans++;
  }
  cout<<min(ans,s.size()-ans)<<"\n";
}
