#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int left_black[200000], right_white[200000];
  int b = 0, w = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      b++;
    }
    if (s[n - 1 - i] == '.') {
      w++;
    }
    left_black[i] = b;
    right_white[n - 1 - i] = w;
  }
  if (s[0] == '#' && w < b) left_black[0]--;
  if (s[n - 1] == '.' && w > b) right_white[n - 1]--;
  int ans = 200000;
  for (int i = 0; i < n - 1; i++) {
    ans = min(ans, left_black[i] + right_white[i + 1]);
  }
  cout << ans << endl;
}
