#include <bits/stdc++.h>
int main() {
  int n;
  int kuro = 0, siro = 0, ans, i, fkuro = 0;
  char input;
  if (scanf("%d ", &n) != 1) return 1;
  for (i = 0; i < n; i++) {
    input = getc(stdin);
    if (input == '#') {
      kuro++;
      break;
    }
  }
  for (; i < n; i++) {
    input = getc(stdin);
    if (input == '#') {
      kuro++;
    } else if (input == '.') {
      siro++;
      break;
    }
  }
  for (; i < n; i++) {
    input = getc(stdin);
    if (input == '#') {
      kuro++;
      fkuro = kuro - 1;
      break;
    } else if (input == '.') {
      siro++;
    }
  }
  for (; i < n; i++) {
    input = getc(stdin);
    if (input == '#') {
      kuro++;
    } else if (input == '.') {
      siro++;
    }
  }
  if (siro < kuro - fkuro) {
    ans = siro;
  } else {
    ans = kuro - fkuro;
  }
  printf("%d\n", ans);
  return 0;
}
