#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int lbl[100001], lwh[100001];
  int bl = 0;
  int wh = 0;
  for (int i = 0; i < n; i++) {
    lbl[i] = bl;
    lwh[i] = wh;
    if (s[i] == '#') {
      bl++;
    } else {
      wh++;
    }
  }
  lbl[n - 1] = bl;
  lwh[n - 1] = wh;
  int ans = n;
  for (int i = 0; i < n; i++) {
    ans = min(ans, lbl[i] + wh - lwh[i]);
  }
  cout << ans << endl;
}
