#include<bits/stdc++.h>
using namespace std;
typedef long long int llint;
typedef long int lint;
typedef vector<char> vchar;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<vector<char>> vvchar;
#define vsort(v) sort((v).begin(), (v).end())
#define vreverse(v) reverse((v).begin(), (v).end())
#define pb(a) push_back(a)
#define INF 1000000007
#define MOD 1e9+7
int main(){
  //input
long long n,i;cin>>n;char s;vint ps(n);
for(i=0;i<n;i++){
  cin>>s;
  if(s =='.'){ps[i]=0;}else{ps[i]=1;}
}
  lint cntt;vint d(0);i=0;
  while(i<n){
    cntt=0;
    if(ps[i]==0){
      while((ps[i]==0)&&(i<n)){i++;cntt++;}
    }else{
      while((ps[i]==1)&&(i<n)){i++;cntt++;}
    }
    d.pb(cntt);
  }
  d.resize();
  long long a,b;a=0;b=0;
  if(ps[0]==1){
    for(i=0;i+1<d.size();i+=2){a+=d[i];b+=d[i+1];}
  }
  else{
  for(i=1;i+1<d.size();i+=2){a+=d[i];b+=d[i+1];}
  }
  if(a>b){cout<<b<<endl;}else{cout<<a<<endl;}
}
