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