#include <bits/stdc++.h>
int main(int argc, char const *argv[]) {
  int n, for_scan, count_dot, count_shap, flag;
  char s_a[200000], now;
  for_scan = scanf("%d", &n);
  for_scan = scanf("%s", s_a);
  now = s_a[0];
  count_dot = count_shap = flag = 0;
  for (int i = 0; i < n; i++) {
    if (s_a[i] == '#') {
      flag = 1;
    }
    if (flag == 1) {
      if (s_a[i] == '#') {
        count_dot++;
      } else {
        count_shap++;
      }
    }
  }
  if (count_dot > count_shap) {
    printf("%d", count_shap);
  } else {
    printf("%d", count_dot);
  }
  return 0;
}
