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