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