#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int count = 0;
  int start_b = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      start_b = i;
      break;
    }
    if (i == N - 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  for (int i = start_b; i < N; i++) {
    if (S[i] == '.') count++;
  }
  int count_b = 0;
  for (int i = start_b; i < N; i++) {
    if (S[i] == '#') {
      count_b++;
    }
  }
  if (count < count_b)
    cout << count << endl;
  else
    cout << count_b << endl;
  return 0;
}
