#include <bits/stdc++.h>
using namespace std;
long long INF = 1 << 29;
int main() {
  ios::sync_with_stdio(false);
  int n, black = 0, white = 0, ans = INT_MAX;
  vector<int> arr;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      arr.push_back(i);
      black++;
    } else
      white++;
  }
  if (black == 0) {
    cout << 0;
    return 0;
  }
  int tmp = 0, sumw = 0;
  for (int i = 0; i < arr.size() - 1; i++) {
    int w = arr[i + 1] - arr[i] - 1;
    sumw += w;
    tmp++;
    ans = min(ans, white - sumw + tmp);
  }
  cout << ans << endl;
  return 0;
}
