#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int N;
  string S;
  cin >> N >> S;
  long long int sum = 0;
  long long int start = N - 1;
  for (long long int i = 0; i < N; i++) {
    if (S.at(i) == '.') {
      continue;
    } else {
      start = i;
      break;
    }
  }
  long long int end = 0;
  for (long long int i = N - 1; i > 0; i--) {
    if (S.at(i) == '#') {
      continue;
    } else {
      end = i;
      break;
    }
  }
  long long int sharp = 0, ten = 0;
  for (long long int j = start; j <= end; j++) {
    if (S.at(j) == '#') {
      sharp++;
    } else {
      ten++;
    }
  }
  sum = min(sharp, ten);
  cout << sum << endl;
  return 0;
}
