#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  vector<int> black;
  int ans = N;
  int min = N;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') black.push_back(i);
  }
  if (black.size() == 0) {
    cout << 0;
    return 0;
  }
  for (int i = 0; i < black.size(); i++) {
    int temp = black.size() - 1 - i;
    int tmp = N - black[i] - temp;
    min = std::min(tmp, min);
  }
  min = std::min(min, (int)black.size());
  cout << min;
  return 0;
}
