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