#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  vector<int> ws(n), bs(n);
  for (int i = 0, w = 0, b = 0; i < n; i++) {
    if (s[i] == '#')
      b++;
    else
      w++;
    ws[i] = w;
    bs[i] = b;
  }
  int wa = ws[n - 1], min_cost = n;
  for (int i = 0, cost; i < n; i++) {
    cost = bs[i] + wa - ws[i];
    if (cost < min_cost) min_cost = cost;
  }
  cout << min_cost << endl;
}
