#include <bits/stdc++.h>
int main() {
  int N;
  int i, j;
  int right;
  int black, white;
  int min;
  scanf("%d", &N);
  int ans[N + 1];
  char S[N];
  scanf("%s", S);
  right = N - 1;
  while (S[right] == '#' && right != 0) right--;
  if (right != N - 1) {
    black = 0;
    white = 0;
    for (i = 0; i <= right; i++) {
      if (S[i] == '#')
        black++;
      else
        white++;
    }
    if (black <= white)
      printf("%d", black);
    else
      printf("%d", white);
  } else {
    for (i = 0; i <= N; i++) {
      black = 0;
      white = 0;
      for (j = 0; j < i; j++) {
        if (S[j] == '#') black++;
      }
      for (j = i; j < N; j++) {
        if (S[j] == '.') white++;
      }
      ans[i] = black + white;
    }
    min = 300000;
    for (i = 0; i <= N; i++) {
      if (ans[i] < min) min = ans[i];
    }
    printf("%d", min);
  }
  return 0;
}
