#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  uint64_t N;
  cin >> N;
  string S;
  cin >> S;
  vector<uint64_t> black(N + 1, 0), white(N + 1, 0);
  for (uint64_t n = 0; n < N + 1; ++n) {
    black[n + 1] = ((S[n] == '#') ? 1 : 0) + black[n];
    white[n + 1] = ((S[n] == '.') ? 1 : 0) + white[n];
  }
  uint64_t count = -1;
  for (uint64_t n = 0; n < N + 1; ++n) {
    uint64_t pw = n, pb = N - n;
    uint64_t qw = white[n] - white[0];
    uint64_t qb = black[N] - black[n];
    count = min(count, (pw - qw) + (pb - qb));
  }
  cout << count << endl;
  return 0;
}
