#include <bits/stdc++.h>
char S[(2 * 10 * 10 * 10 * 10 * 10)];
int main() {
  int N;
  int cnt = 1;
  int i;
  int result = 0;
  int btotal = 0;
  int bpre = 0;
  int bpost = 0;
  int wtotal = 0;
  int wpre = 0;
  int wpost = 0;
  int b1st = -1;
  int index_b1st = 0;
  int isw = 0;
  char dummy;
  cnt = scanf("%d", &N);
  cnt = scanf("%*c", &dummy);
  i = 0;
  cnt = 1;
  while (cnt == 1) {
    cnt = scanf("%c", &S[i]);
    if (cnt != 1) break;
    if ((S[i] != '.') && (S[i] != '#')) break;
    if (i == N) break;
    if (S[i] == '.') {
      wtotal++;
      if (b1st == -1) {
        wpre++;
      } else {
        wpost++;
      }
    } else {
      btotal++;
      if (b1st == -1) {
        b1st = i;
      } else {
        bpost++;
      }
    }
    i++;
  }
  if (b1st == -1) {
    printf("0");
    return 0;
  }
  if ((wpost) > (bpost + 1)) {
    result = bpost + 1;
  } else {
    result = wpost;
  }
  printf("%d", result);
  return 0;
}
