#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 2e5 + 5;
char second[MAXN];
int b[MAXN], w[MAXN];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf(" %c", &second[i]);
  }
  for (int i = 1; i <= n; i++) {
    if (second[i - 1] == '#') {
      b[i]++;
    }
    b[i] += b[i - 1];
  }
  for (int i = n; i >= 1; i--) {
    if (second[i - 1] == '.') {
      w[i]++;
    }
    w[i] += w[i + 1];
  }
  int ans = MAXN + 1;
  for (int i = 1; i <= n; i++) {
    ans = min(ans, b[i] + w[i + 1]);
  }
  printf("%d", ans);
}
