#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0;
  cin >> n;
  string stones = "";
  cin >> stones;
  int cnt_w = 0, cnt_b = 0;
  int buf = 0;
  for (auto iter = stones.begin(); iter != stones.end(); iter++) {
    if (*iter == '#') {
      buf++;
    } else {
      cnt_b += buf;
      buf = 0;
    }
  }
  buf = 0;
  for (auto iter = stones.rbegin(); iter != stones.rend(); iter++) {
    if (*iter == '.') {
      buf++;
    } else {
      cnt_w += buf;
      buf = 0;
    }
  }
  cout << min(cnt_w, cnt_b) << endl;
  return 0;
}
