#include <bits/stdc++.h>
void print_int(int n) { printf("%d\n", n); }
void swap(int* a, int* b) {
  int t = *a;
  *a = *b;
  *b = t;
}
void sort(int a[], int n) {
  for (int i = 1; i < n; i++) {
    int j = i - 1;
    while (j >= 0 && a[j + 1] > a[j]) {
      swap(&a[j + 1], &a[j]);
      j--;
    }
  }
}
void print_list(int a[], int n) {
  for (int i = 0; i < n; i++) {
    print_int(a[i]);
  }
}
char s[200000];
int main(void) {
  int n;
  scanf("%d", &n);
  scanf("%s", s);
  int min = n;
  int temp = 0;
  int flag = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      flag = 1;
      int k = 0;
      for (int j = i + 1; j < n; j++) {
        if (s[j] == '.') {
          k++;
        }
      }
      if (k + temp < min) min = k + temp;
      temp++;
    }
  }
  if (flag == 0) min = 0;
  print_int(min);
  return 0;
}
