#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, ans;
  string S;
  cin >> N >> S;
  for (ans = 0; ans < N; ans++) {
    if (S[N - ans - 1] == '.') break;
  }
  N -= ans;
  long long c = 0;
  for (long long i = 0; i < N; i++) {
    if (S[i] == '.') c++;
  }
  cout << min(c, N - c) << endl;
  return 0;
}
