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