#include <bits/stdc++.h>
using namespace std;
int n;
string s;
void solve() {
  int ansW = 0;
  int tmpW = 0;
  int ansB = 0;
  int tmpB = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '#') {
      ansW += tmpW;
      tmpW = 0;
    } else {
      tmpW++;
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      ansB += tmpB;
      tmpB = 0;
    } else {
      tmpB++;
    }
  }
  cout << min(ansB, ansW) << endl;
}
int main() {
  cin >> n >> s;
  solve();
}
