#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
__attribute__((constructor)) void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}
int main() {
  int N;
  string S;
  cin >> N >> S;
  bool gotBlack = false;
  int cntB = 0;
  int cntW = 0;
  for (int i = 0; i < (N); i++) {
    if (S[i] == '#') {
      gotBlack = true;
    }
    if (gotBlack && S[i] == '.') {
      cntB++;
    }
    if (gotBlack && S[i] == '#') {
      cntW++;
    }
  }
  cout << min(cntB, cntW) << endl;
}
