#include <bits/stdc++.h>
using namespace std;

int main(){
  int N;
  string S;
  cin >> N >> S;
  int ans;
  for (int i=0;i<N;i++){
    if(S[i]=='.') ans++;
  }
  int now=ans;
  for (int i=0;i<N;i++){
    if(S[i]=='#') now++;
    else now--;
    ans=min(ans,now);
  }
  cout << ans << endl;
}
