#include<bits/stdc++.h>
using namespace std;
int main() {
  long long N, bit=0, bittest=0, bitxor, ans=200000; cin >> N;
  char c;
  for (long long i=0; i<N; i++) {
    cin >> c;
    if (c=='#') bit |= 1<<(N-1-i);
  }
  ans = min(ans,__builtin_popcount(bit^0));
  for (long long i=0; i<=N; i++) {
    bittest |= 1<<i;
    bitxor = bit^bittest;
    ans = min(ans,__builtin_popcount(bitxor));
  }
  cout << ans << "\n";
}