#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long A, B = 0, C, N, K;
  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;
    }
  }
  cout << min(A - B, N - B) << endl;
}
