#include <bits/stdc++.h>
int main(void) {
  int N;
  char S[200000];
  int kioku = 2;
  int count = 0;
  scanf("%d", &N);
  scanf("%s", S);
  for (int a = 0; a < N; a++) {
    if (S[a] == '.' && kioku == 1) {
      S[a - 1] = '.';
      count += 1;
    }
    if (S[a] == '.')
      kioku = 0;
    else if (S[a] == '#')
      kioku = 1;
  }
  printf("%d", count);
  return 0;
}
