#include <bits/stdc++.h>
char s[2000001];
int main(void) {
  int n;
  scanf("%d", &n);
  scanf("%s", s);
  int i;
  int ans = 0, white = 0, black = 0;
  int wn = 0, bn = 0;
  i = 0;
  while (s[i] == '.') {
    white++;
    i++;
  }
  i = n - 1;
  while (s[i] == '#') {
    black++;
    i--;
  }
  for (i = white; i < n - black; i++) {
    if (s[i] == '.') wn++;
    if (s[i] == '#') bn++;
  }
  ans = wn;
  if (ans > bn) ans = bn;
  printf("%d", ans);
}
