#include <bits/stdc++.h>
int min(int m, int n) {
  if (m > n)
    return n;
  else
    return m;
}
int main(void) {
  int n;
  char s[201000];
  scanf("%d %s", &n, s);
  int dot = 0;
  for (int i = 0; i < n; i++)
    if (s[i] == '.') dot++;
  int ans = dot;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#')
      ans++;
    else
      ans--;
    ans = min(ans, dot);
  }
  printf("%d", ans);
  return 0;
}
