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

int main() {
  
  int N;
  string S;

  cin >> N >> S;
  int b = 0,w = 0;
  for(int i = 0;i < N;i++) {
    if(S.at(i) == '.') w++;
  }
  S = 'a' + S + 'a';

  int ans = 10000000;
  for(int i = 0;i < S.size();i++) {
    int sum;
    if(S.at(i) == '#') b++;
    else if(S.at(i) == '.') w--;
    sum = b+w;
    ans = min(ans,sum);
  }
  
  cout << ans << endl;


}

