#include <bits/stdc++.h>
int main(void) {
  int n, count1 = 0, count2 = 0;
  char s[200001], t[200001];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", &s[i]);
    t[i] = s[i];
  }
  for (int j = 0; j < n; j++) {
    if (s[j] == '#' && s[j + 1] == '.') {
      count1++;
      s[j + 1] = '#';
    }
  }
  for (int k = n - 1; k >= 0; k--) {
    if (t[k] == '.' && t[k - 1] == '#') {
      count2++;
      t[k - 1] = '.';
    }
  }
  if (count1 >= count2) {
    printf("%d", count2);
  } else {
    printf("%d", count1);
  }
  return 0;
}
