#include <bits/stdc++.h>
using namespace std;
char a[200001];
int main() {
  int n, i, s1 = 0, s2 = 0;
  scanf("%d", &n);
  scanf("%s", a);
  for (i = 0; i < n; i++) {
    if (a[i] == '#')
      s1++;
    else
      s2++;
  }
  printf("%d", min(s1, s2));
  return 0;
}
