#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int count_W[N];
  int count_B[N];
  int cw = 0;
  int cb = 0;
  for (int i = 0; i < N; i++) {
    count_B[i] = cb;
    if (S[i] == '#') cb++;
    count_W[N - i - 1] = cw;
    if (S[N - i - 1] == '.') cw++;
  }
  int minimum = N + 1;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') minimum = min(minimum, count_W[i] + count_B[i]);
  }
  cout << (cb > 0 ? minimum : 0) << endl;
  return 0;
}
