#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, k1 = 0, k2 = 0, flag = 0;
  char a[200050];
  scanf("%d", &n);
  getchar();
  for (i = 0; i < n; i++) scanf("%c", &a[i]);
  i = 0;
  while (a[i] == '.') i++;
  for (i = i + 1; i < n; i++)
    if (a[i] == '.') k1++;
  i = 0;
  while (a[n - 1] != '.' && n >= 0) n--;
  while (a[i] == '.' && i < n) i++;
  for (i = i + 1; i < n; i++)
    if (a[i] == '#') k2++;
  if (k1 <= k2)
    printf("%d\n", k1);
  else
    printf("%d\n", k2);
  return 0;
}
