#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string S;
  cin >> N >> S;
  int left = 0;
  while (left < N) {
    if (S[left] == '#') break;
    ++left;
  }
  int black = 0;
  int white = 0;
  for (int i = left + 1; i < N; ++i) {
    if (S[i] == '.') {
      ++white;
    }
  }
  for (int i = left; i < N; ++i) {
    if (S[i] == '#') {
      ++black;
    }
  }
  cout << min(white, black) << endl;
  return 0;
}
