#include <bits/stdc++.h>
using namespace std;
char a[200001];
int n, b[200001];
int next(int k) {
  int i;
  for (i = k + 1; i <= n; i++) {
    if (b[i]) return i;
  }
  return 0;
}
int main() {
  int i, cnt = 0, black = 0, white = 0, ans = INT_MAX;
  scanf("%d", &n);
  getchar();
  for (i = 1; i <= n; i++) {
    scanf("%c", &a[i]);
    if (a[i] == '#') black++;
  }
  for (i = n; i >= 1; i--) {
    if (a[i] == '.')
      white++;
    else {
      b[i] = white;
    }
  }
  for (i = 1; i <= n; i++) {
    if (b[i]) ans = min(ans, b[next(i)] + cnt);
    if (a[i] == '#') cnt++;
  }
  printf("%d", min(ans, black));
  return 0;
}
