#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string S;
  bool flag = false;
  cin >> N >> S;
  int black = 0;
  int white = 0;
  int wb = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      white++;
      if (flag == true) {
        wb++;
      }
    }
    if (S[i] == '#') {
      black++;
      if (flag == false) {
        flag = true;
      }
    }
  }
  cout << min({white, black, wb}) << endl;
}
