#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  set<pair<int, char>> data;
  cin >> n >> s;
  int count[2] = {0};
  for (auto i : s) {
    if (i == '.')
      ++count[0];
    else
      ++count[1];
  }
  const char token = (count[0] < count[1]) ? '.' : '#';
  long i;
  for (i = s.size() - 1; i >= 0 && s[i] == '#'; --i) {
  }
  int num = 0;
  for (; i >= 0; --i) {
    if (s[i] == token) num++;
  }
  cout << num << endl;
  return 0;
}
