#include <bits/stdc++.h>
const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int mod = (int)1e9 + 7;
const int maxn = (int)2e5 + 5;
using namespace std;
char s[maxn];
long long sum[maxn];
int32_t main() {
  long long n;
  scanf("%lld", &n);
  scanf(" %s", s + 1);
  long long cnt = 0;
  for (long long i = 1; i <= (n); i++)
    if (s[i] == '#') sum[i] = 1, cnt++;
  for (long long i = n; i >= (1); i--) sum[i] += sum[i + 1];
  long long ans = inf;
  for (long long i = 1; i <= (n); i++) {
    if (ans == '#') ans = min(ans, (n - i + 1) - sum[i] + cnt - sum[i]);
  }
  if (ans == inf) ans = 0;
  cout << ans << endl;
  return 0;
}
