#include <bits/stdc++.h>
#pragma warning(disable : 4996)
char S[200000 + 1];
int W[200000 + 1];
int B[200000 + 1];
int main(void) {
  int N;
  char S[10 + 1];
  scanf("%d", &N);
  scanf("%s", &S[0]);
  int numW = 0;
  int numB = 0;
  for (int i = 0; i < N; ++i) {
    if (S[i] == '.') ++numW;
    if (S[N - 1 - i] == '#') ++numB;
    W[i] = numW;
    B[N - 1 - i] = numB;
  }
  int min = N;
  for (int i = 0; i < N; ++i) {
    if (W[i] + B[i] < min) {
      min = W[i] + B[i];
    }
  }
  printf("%d", min);
  return 0;
}
