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