#include <bits/stdc++.h>
int main() {
  int n, i, cnt = 0, cnt1 = 0;
  scanf("%d", &n);
  getchar();
  char a[n + 5];
  gets(a);
  int flag = 0;
  for (i = 0; i < n; i++) {
    if (flag == 0 && a[i] == '#') flag = 1;
    if (flag == 1 && a[i] == '.') cnt++;
  }
  flag = 0;
  for (i = n - 1; i >= 0; i--) {
    if (flag == 0 && a[i] == '.') flag = 1;
    if (flag == 1 && a[i] == '#') cnt1++;
  }
  if (cnt <= cnt1)
    printf("%d\n", cnt);
  else
    printf("%d\n", cnt1);
  return 0;
}
