#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> white(N + 1, 0), black(N + 1, 0);
  int w = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      w++;
    }
  }
  bool bla = false;
  for (int i = 0; i < N; i++) {
    white[i + 1] = white[i];
    black[i + 1] = black[i];
    if (S[i] == '#') {
      black[i + 1]++;
    } else {
      bla = true;
      white[i + 1]++;
    }
  }
  int ans = 2147483647;
  for (int i = 0; i < N; i++) {
    ans = min(ans, black[i + 1] + w - white[i + 1]);
  }
  if (bla) {
    cout << ans << endl;
  } else {
    cout << 0 << endl;
  }
  getchar();
  getchar();
  return 0;
}
