#include <bits/stdc++.h>
using namespace std;
char s[200002];
int nr0_pref[200002], nr1_pref[200002], nr0_suf[200002], nr1_suf[200002];
int main() {
  int i, n, j, nr;
  scanf("%d\n%s", &n, s + 1);
  for (i = 1; i <= n; i++) {
    nr0_pref[i] = nr0_pref[i - 1] + (s[i] == '#');
    nr1_pref[i] = nr1_pref[i - 1] + (s[i] == '.');
  }
  for (i = n; i >= 1; i--) {
    nr0_suf[i] = nr0_suf[i + 1] + (s[i] == '#');
    nr1_suf[i] = nr1_suf[i + 1] + (s[i] == '.');
  }
  nr = n + 1;
  for (i = 0; i <= n + 1; i++) {
    nr = min(nr, nr0_pref[i] + nr1_suf[i + 1]);
  }
  printf("%d", nr);
  return 0;
}
