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

int main() {
  int N;
  string S;
  cin >> N >> S;
  
  int count = 0;
  
  for (int i = 0; i < N; i++){
    if (S.at(i) == '.'){
     count++;
    }
  }
  
  int ans = count;
  
  for (int i = 0; i < N; i++){
    if (S.at(i) == '.'){
      count--;
    } else {
      count++;
    }
    ans = min(ans, count);
  }

     
  cout << ans << endl;

}