#include <iostream>
#include <string>

int b[200005], w[200005]; // i番目までの黒, 白の個数
int N;
string S;

int main() {
  
  cin >> N >> S;
  
  b[0] = 0;
  w[0] = 0;
  for(int i=0;i<N;++i) {
    b[i+1] = b[i] + (S[i] == '.' ? 1 : 0);
    w[i+1] = w[i] + (S[i] == '#' ? 1 : 0);
  }
  
  int ans = N;
  for(int i=0;i<=N;++i) {
    if(w[i]+(b[N]-b[i]) < ans) ans = b[i]+(w[N]-w[i]);
  }
  cout << ans << endl;
}