#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long A, B = 0, C, N, K = 0;
  string S, W, T;
  cin >> N >> S;
  for (long long i = 0; i < N; i++) {
    if (S.at(i) == '.') {
      if (B == 0) A = N - i;
      B += 1;
    }
  }
  for (long long i = N; i > N; i--) {
    if (S.at(i) == '#') {
      if (N == 0) C = N - 1;
      K += 1;
    }
  }
  cout << min(A - B, C - K) << endl;
}
