#include <bits/stdc++.h>
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long nPr(int n, int r) {
  long long i, result = 1;
  for ((i) = 0; (i) < (r); (i)++) {
    result *= (long long)(n - i);
  }
  return result;
}
long long nCr(int n, int r) {
  long long i, result = 1;
  if (n < r) return 0;
  for ((i) = 0; (i) < (((r) < (n - r) ? (r) : (n - r))); (i)++) {
    result *= (long long)(n - i);
    result /= (long long)(i + 1);
  }
  return result;
}
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}, dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int upint(const void *a, const void *b) {
  return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0;
}
int downint(const void *a, const void *b) {
  return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0;
}
int upchar(const void *left, const void *right) {
  return strcmp((char *)left, (char *)right);
}
int downchar(const void *left, const void *right) {
  return strcmp((char *)right, (char *)left);
}
void tmpInit(int *c, long long m) {
  long long i;
  for ((i) = 0; (i) < (m); (i)++) c[i] = i;
}
long long modpow(long long a, long long n, long long mod) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) {
      res *= a;
      if (mod >= 1) res %= mod;
    }
    a *= a;
    if (mod >= 1) a %= mod;
    n >>= 1;
  }
  return res;
}
void initialize() {}
int main(void) {
  initialize();
  long long n, m, i, j, k, result = 0, tmp = 0, tmp2 = 0;
  int a[500002] = {0};
  char s[200002];
  scanf("%lld", &n);
  scanf("%s", s);
  result = 1 << 29;
  for ((i) = 0; (i) < (n); (i)++) {
    tmp2 += ((s[i] == '.') ? 1 : 0);
  }
  for ((i) = 0; (i) < (n); (i)++) {
    tmp += ((s[i] == '#') ? 1 : 0);
    tmp2 -= ((s[i] == '.') ? 1 : 0);
    result = ((result) < (tmp + tmp2) ? (result) : (tmp + tmp2));
  }
  printf("%lld", result);
  return 0;
}
