#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, ans = 0, b = 0, w = 0;
  string s;
  cin >> n >> s;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == '#') break;
  }
  for (j = i; j < s.size(); j++) {
    if (s[j] == '.')
      w++;
    else
      b++;
  }
  cout << min(b, w) << endl;
}
