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