#include <bits/stdc++.h>
using namespace std;
int search_left_white(int l, int r, int n, string S);
int search_right_black(int l, int r, int n, string S);
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int left = -1;
  int right = N;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      left = i + 1;
      break;
    }
  }
  if (left < 0) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = N - 1; i >= 0; i--) {
    if (S[i] == '.') {
      right = i;
      break;
    }
  }
  if (right > (N - 1)) {
    cout << 0 << endl;
    return 0;
  }
  int min = N;
  for (int i = left; i <= right; i++) {
    int count = 0;
    count += search_left_white(left, right, i, S);
    count += search_right_black(left, right, i, S);
    if (count < min) {
      min = count;
    }
  }
  cout << min << endl;
  return 0;
}
int search_left_white(int l, int r, int n, string S) {
  int count = 0;
  for (int i = l; i <= n; i++) {
    if (S[i] == '#') {
      count++;
    }
  }
  return count;
}
int search_right_black(int l, int r, int n, string S) {
  int count = 0;
  for (int i = r; i >= n; i--) {
    if (S[i] == '.') {
      count++;
    }
  }
  return count;
}
