#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  char S[N];
  int LW = 0, LB = 0, RW = 0, RB = 0;
  for (int i = 0; i < N; i++) {
    cin >> S[i];
    S[i] == '#' ? RB++ : RW++;
  }
  vector<int> count;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      RB--;
      LB++;
    }
    if (S[i] == '.') {
      RW--;
      LW++;
    }
    if (S[i] == '.' && S[i + 1] == '#') {
      count.push_back(LB + RW);
    }
  }
  if (count.size() == 0) {
    cout << 0;
  } else {
    cout << *min_element(count.begin(), count.end());
  }
}
