#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  vector<bool> b(n);
  for (int i = 0; i < n; i++) b[i] = s[i] == '#';
  vector<int> x(n), y(n);
  int c = 0, d = 0;
  for (int i = 0; i < n; i++) {
    if (b[i]) c++;
    x[i] = c;
    if (!b[n - i]) d++;
    y[n - 1 - i] = d;
  }
  int r = y[0];
  for (int i = 0; i < n; i++) {
    int t = x[i] + y[i + 1];
    if (t < r) r = t;
  }
  cout << r << endl;
  return 0;
}
