#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  string S;
  cin >> S;
  long long ans = 0;
  long long whi = 0, bla = 0;
  char a = S[0];
  char b = S[N - 1];
  for (long long i = 0; i < N; ++i) {
    if (S[i] == '.') {
      whi++;
    } else {
      bla++;
    }
  }
  if (whi >= bla) {
    ans = bla;
    if (ans == N) {
      ans = 0;
    }
  } else {
    ans = whi;
    if (a == '.') {
      ans--;
    }
    if (ans == N - 2) {
      ans = 0;
    }
  }
  cout << ans << endl;
}
