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