#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  vector<int> left_black(n);
  vector<int> right_white(n);
  int black = 0;
  for (int i = (0); i < (n); ++i) {
    left_black[i] = (s[i] == '#') ? ++black : black;
  }
  int white = 0;
  for (int i = n - 1; i >= 0; i--) {
    right_white[i] = (s[i] == '.') ? ++white : white;
  }
  int middle_ans = INT_MAX;
  for (int i = (0); i < (n); ++i) {
    middle_ans = min(middle_ans, left_black[i] + right_white[i]);
  }
  int ans = min(middle_ans, min(black, white));
  cout << ans << endl;
}
