#include <bits/stdc++.h>
const int N = 200005;
char a[N];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", a);
  int x = 0, y = 0;
  for (int i = 0; i < n; i++) {
    x += (a[i] == '.');
    y += (a[i] == '#');
  }
  printf("%d\n", std::min(x, y));
  return 0;
}
