#include <bits/stdc++.h>
int main(void) {
  int N;
  scanf("%d", &N);
  char S[N + 1];
  scanf("%s", S);
  int max = strlen(S);
  int ans = max;
  int idx = 1;
  int left = 0;
  int right = 0;
  int i;
  int flag = 1;
  for (i = 0; i < N - 1; i++) {
    if (S[i] != S[i + 1]) {
      flag = 0;
      break;
    }
  }
  for (idx = 1; idx <= N - 1; idx++) {
    for (i = 0; i < idx; i++) {
      if (S[i] == '#') left++;
    }
    for (i = idx; i < N; i++) {
      if (S[i] == '.') right++;
    }
    if (ans > (left + right)) {
      ans = left + right;
    }
    left = 0;
    right = 0;
  }
  if (flag == 1) {
    printf("0\n");
  } else {
    printf("%d", ans);
  }
  return 0;
}
