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

int main(){
  int N;
  cin >> N;
  
  string S;
  cin >> S;
  
  vector<int> res(N + 1);
  
  int left = 0;
  int right = count(S.begin(), S.end(), '.');
  res.at(0) = left + right;
  
  for(int i = 0; i < N; i++){
    if(S.at(i) == '#')
      left++;
    else
      right--;
    
    res.at(i + 1) = left + right;
  }
  
  cout << *min_element(res.begin(), res.end()) << endl;
}
