#include <bits/stdc++.h>
using namespace std;
const int INF = 2000000000;
int N;
string S;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> S;
  vector<int> b_sum(N + 1, 0);
  vector<int> w_sum(N + 1, 0);
  for (int i = 1; i <= N; i++) {
    if (S[i - 1] == '#') {
      b_sum[i] = b_sum[i - 1] + 1;
    } else {
      b_sum[i] = b_sum[i - 1];
    }
    if (S[i - 1] == '.') {
      w_sum[i] = w_sum[i - 1] + 1;
    } else {
      w_sum[i] = w_sum[i - 1];
    }
  }
  int ans = INF;
  for (int i = 0; i < N; i++) {
    int tmp = 0;
    tmp += (b_sum[i + 1] - b_sum[0]);
    tmp += (w_sum[N] - w_sum[i + 1]);
    ans = min(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}
