#include <cstdio>
#include <algorithm>

int w[200001];
int b[200001];

int main()
{
  int n;
  char s[200001];
  scanf("%d%s", &n, s);
  for (int i = 0; i < n; ++i)
  {
    w[i + 1] = w[i] + (s[i] == '.' ? 1 : 0);
    b[i + 1] = b[i] + (s[i] == '#' ? 1 : 0);
  }
  int ans = 1e8;
  for (int i = 0; i <= n; ++i)
  {
    ans = std::min(ans, b[i] + w[n] - w[i]);
  }
  printf("%d\n", ans);
  return 0;
}