#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> nWhites(N + 1, 0);
  vector<int> nBlacks(N + 1, 0);
  nBlacks[N - 1] = (S[N - 1] == '.');
  for (int i = N - 2; i >= 0; --i) {
    if (S[i] == '.') {
      nBlacks[i] = nBlacks[i + 1] + 1;
    } else {
      nBlacks[i] = nBlacks[i + 1];
    }
  }
  nWhites[1] = (S[0] == '#');
  for (int i = 2; i <= N; ++i) {
    if (S[i] == '#') {
      nWhites[i] = nWhites[i - 1] + 1;
    } else {
      nWhites[i] = nWhites[i - 1];
    }
  }
  int ans = 1e9;
  for (size_t i = 0; i < nWhites.size(); ++i) {
    ans = min(ans, nWhites[i] + nBlacks[i]);
  }
  cout << ans << endl;
  return 0;
}
