#include <bits/stdc++.h>
int main(void) {
  int n;
  int s = 0, t = 0;
  int i = 0, j = 0;
  scanf("%d", &n);
  char str[n];
  int str1[n];
  int att[n + 1][n];
  int sum[n];
  int min = n;
  scanf("%s", str);
  for (i = 0; i < n; i++) {
    if (str[i] != '#')
      str1[i] = 0;
    else
      str1[i] = 1;
  }
  for (i = 0; i <= n + 1; i++) {
    sum[i] = 0;
    for (j = 0; j < n; j++) {
      if (n - i >= j)
        att[i][j] = 0;
      else
        att[i][j] = 1;
      if (str1[j] != att[i][j]) sum[i]++;
    }
  }
  for (i = 0; i <= n + 1; i++) {
    if (min > sum[i]) min = sum[i];
  }
  printf("%d", min);
  return 0;
}
