#include <bits/stdc++.h>
int main(void) {
  int n, i = 0, ans = 0, cnts = 0, cntd = 0;
  char s[10 * 10 * 10 * 10 * 10 * 10];
  scanf("%d", &n);
  scanf("%s", s);
  while (s[i] != '\0') {
    if (s[i] == '#') {
      cnts++;
    } else if (s[i] == '.') {
      cntd++;
    }
    i++;
  }
  if (cntd > cnts)
    ans = cnts;
  else
    ans = cntd;
  printf("%d\n", ans);
  return 0;
}
