#include <bits/stdc++.h>
using namespace std;
uint64_t MOD = 1000000007;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int ans = 0, nW = 0, nB = 0;
  for (int i = S.size() - 1; i >= 0; i--) {
    if (S.at(i) == '.')
      nW++;
    else {
      if (nW != 0) nB++;
      ans = nW;
    }
  }
  ans = min(ans, nB);
  cout << ans << endl;
}
