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

int main() {
  int N;
  string S;

  cin >> N;
  cin >> S;

  int b = 0;
  for(int i=0;i<N;i++)
    if( S[i] == '.') b++;

  vector<int> c;
  c.push_back(b);
  for(int i=0;i<N;i++){
    if(S[i] == '#'){
      c.push_back(c[i]+1);
    }else{
      c.push_back(c[i]-1);
    }
  }

  int min=N;
  for(int n:c)
    if(min>n) min=n;

  cout << min;

  return 0;
}
