#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  char S[N];
  for (int i = N - 1; i >= 0; --i) cin >> S[i];
  vector<int> A;
  if (S[0] == '.') A.push_back(0);
  int count = 0;
  bool can = true;
  for (int i = 0; i < N; ++i) {
    count++;
    if (S[i] != S[i + 1]) {
      A.push_back(count);
      can = false;
    }
    count = 0;
  }
  vector<int> AAA;
  int sum = 0;
  for (int i = 0; i < A.size(); ++i) {
    if (i % 2 == 1) {
      sum -= A[i];
    } else
      sum += A[i];
    AAA.push_back(A[i]);
  }
  int mmnn = 0;
  int AAmn = AAA[0];
  for (int i = 0; i < AAA.size(); ++i) {
    if (AAmn > AAA[i]) {
      AAmn = AAA[i];
      mmnn = i;
    }
  }
  int ans = 0;
  for (int i = 0; i < mmnn; ++i) {
    if (i % 2 == 0) ans += A[i];
  }
  for (int i = mmnn + 1; i < AAA.size(); ++i) {
    if (i % 2 == 1) ans += A[i];
  }
  if (can)
    cout << 0 << endl;
  else
    cout << ans << endl;
}
