#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int left = -1;
  int right = -1;
  int count = 0;
  int count2 = 0;
  bool flag = false;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#' && left == -1) {
      left = i;
    }
    if (S[N - i - 1] == '.' && right == -1) {
      right = N - i - 1;
    }
    if (left != -1 && S[i] == '.') {
      flag = true;
    }
  }
  for (int i = left; i < N; i++) {
    if (S[i] == '.') {
      count++;
    }
  }
  for (int i = 0; i < right + 1; i++) {
    if (S[i] == '#') {
      count2++;
    }
  }
  count = min(count, count2);
  if (left == -1 || !flag) {
    cout << 0 << endl;
  } else {
    cout << count << endl;
  }
}
