#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string S;
  cin >> N >> S;
  int ans = N + 1;
  int numWhiteRemain = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      numWhiteRemain++;
    }
  }
  if (numWhiteRemain == 0 || numWhiteRemain == N) {
    ans = 0;
  }
  int numChangedBlack = 0;
  for (int i = 0; i < N; i++) {
    int change = 0;
    if (S[i] == '#') {
      numWhiteRemain--;
      numChangedBlack++;
    }
    change = numWhiteRemain + numChangedBlack;
    if (change < ans) {
      ans = change;
    }
  }
  cout << ans << endl;
  return 0;
}
