#include <bits/stdc++.h>
char a[200005];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", a, 200005);
  int i = 0;
  for (i = 0; i < n; i++) {
    if (a[i] == '#') break;
  }
  int r = n - 1;
  for (r = n - 1; r >= 0; r--) {
    if (a[r] == '.') break;
  }
  int sum1 = 0, sum2 = 0;
  int j = i + 1;
  for (j = i + 1; j < n; j++) {
    if (a[j] == '#') break;
  }
  int s = r - 1;
  for (s; s >= 0; s--) {
    if (a[s] == '.') break;
  }
  int begain, last;
  if (j - i > 2) {
    begain = j;
    sum1 += 1;
    sum2 += 1;
  } else
    begain = i;
  if (r - s > 2) {
    last = s;
    sum1 += 1;
    sum2 += 1;
  } else
    last = r;
  for (int x = begain; x <= last; x++) {
    if (a[x] == '#')
      sum1++;
    else
      sum2++;
  }
  int min = sum1;
  if (sum2 < sum1) min = sum2;
  printf("%d", min);
  return 0;
}
