#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using graph = std::vector<std::vector<long long>>;
int main() {
  ll N;
  string S;
  cin >> N >> S;
  bool judge = false;
  ll cB = 0;
  ll cW = 0;
  for (int i = 0; i < N; ++i) {
    if (S[i] == '#') {
      judge = true;
    }
    if (S[i] == '.' && judge) {
      cB++;
    }
  }
  judge = false;
  for (int i = N - 1; i >= 0; --i) {
    if (S[i] == '.') {
      judge = true;
    }
    if (S[i] = '#' && judge) {
      cW++;
    }
  }
  cout << min(cW, cB) << endl;
}
