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