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