#include <bits/stdc++.h>
using namespace std;
int main() {
  long int N;
  cin >> N;
  cin.ignore();
  string S;
  getline(cin, S);
  int kuro_exist = 0;
  long int num_change_siro = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      kuro_exist = 1;
    } else if (kuro_exist == 1) {
      num_change_siro += 1;
    }
  }
  int siro_exist = 0;
  long int num_change_kuro = 0;
  for (int i = N - 1; i > -1; i--) {
    if (S[i] == '.') {
      siro_exist = 1;
    } else if (siro_exist == 1) {
      num_change_kuro += 1;
    }
  }
  cout << min(num_change_siro, num_change_kuro) << endl;
}
