#include <bits/stdc++.h>
int main(void) {
  int num;
  char str[20000];
  char tmp[20000];
  int l_cnt = 0;
  int r_cnt = 0;
  scanf("%d", &num);
  scanf("%s", str);
  for (int i = 0; i < num; i++) {
    tmp[i] = str[i];
  }
  for (int i = 0; i < num - 1; i++) {
    if (tmp[i] == '#' && tmp[i + 1] == '.') {
      tmp[i + 1] = '#';
      l_cnt++;
    }
  }
  for (int i = num - 1; i > 0; i--) {
    if (str[i - 1] == '#' && str[i] == '.') {
      str[i - 1] = '.';
      r_cnt++;
    }
  }
  printf("%d\n", l_cnt <= r_cnt ? l_cnt : r_cnt);
  return 0;
}
