#include <bits/stdc++.h>
char s[1000000], ch;
using namespace std;
int main() {
  long long n, m = 0, i, k = 0, sum;
  cin >> n;
  m = k = 0;
  while (n--) {
    cin >> ch;
    if (ch == '.') m++;
    if (ch == '#') k++;
  }
  sum = min(m, k);
  cout << sum << endl;
  return 0;
}
