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

int main(void){
  int N;
  string S;
  cin >> N >> S;
  
  int ls = 0, rd = 0;
  for (char c: S) {
    if (c == '.') { rd++; }
  }
  int ans = rd;
  for (char c: S) {
    if (c == '#' ) {
      ls++;
    } else {
      rd--;
    }
    if (ls+rd < ans) { ans = ls+rd; }
  }
  
  cout << ans;
}