#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
typedef vector<pii> vii;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define rep(i,n) for(int i=0;i<((int)n);i++)
#define rep1(i,n) for(int i=1;i<=((int)n);i++)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}

//}}}
const ll maxn= 200005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const double PI=acos(-1);
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;

		b>>=1;
	}
	return res;
}

ll dp[maxn][maxn][maxn],n,t;
int main()
{
	//IOS;
    string s;
    int white[maxn],black[maxn];
    while(cin>>n>>s)
    {
        memset(black,0,sizeof(black));
        memset(white,0,sizeof(white));
        rep(i,n)
        {
            if(i) {black[i]+=black[i-1];white[i]+=white[i-1];}
            if(s[i]=='#') black[i]++;
            else white[i]++;
        }
        int minchange=white[n-1];
        rep(i,n)
        {
            minchange=min(minchange,black[i]+white[n-1]-white[i]);
        }
        cout<<minchange<<"\n";
    }
	return 0;
}
