#include <bits/stdc++.h>
int main(void) {
  int N;
  char S[200010];
  int rui[200020];
  scanf("%d", &N);
  scanf("%s", &S);
  int i = 0;
  int count = 0;
  while (S[i] == '.') {
    count++;
    i++;
  }
  if (i == 0) i = 1;
  rui[0] = count;
  int j = 1;
  while (i < N) {
    count = 0;
    while (S[i] == '#') {
      count++;
      i++;
    }
    rui[j] = count;
    j++;
    count = 0;
    while (S[i] == '.') {
      count++;
      i++;
    }
    rui[j] = count;
    j++;
    count = 0;
  }
  int ans;
  if (rui[1] <= rui[2])
    ans = rui[1];
  else
    ans = rui[2];
  i = 4;
  while (i < N) {
    ans += rui[i];
    i = i + 2;
  }
  printf("%d", ans);
  return 0;
}
