#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pb push_back
typedef long long  ll;
typedef long double ld;
typedef pair<ll ,ll > pll;
typedef pair<int ,int > pii;
const ld pi=3.14159265359;
const int maxn=2e5+7;
const int mod=1e9+7;
const ll INF=9223372036854775807;
const int inf=2e9+7; 
/*Almost copy pasted part :)*/
int a[maxn];
int dp[maxn][2];

int main(){
	int n;
	cin>>n;
	string s;
	cin>>s;
	for(int i=0;i<n;i++){
		a[i+1]=(s[i]!='.');
	}	
	for(int i=1;i<=n;i++){
		if(a[i]==0){
			dp[i][0]=dp[i-1][0];
			dp[i][1]=min(dp[i-1][0],dp[i-1][1])+1;
		}
		else{
			dp[i][1]=min(dp[i-1][1],dp[i-1][0]);
			dp[i][0]=dp[i-1][0]+1;
		}
	}
	cout<<min(dp[n][0],dp[n][1])<<endl;
}