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