#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int index = 0, ww = 0;
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  int b[n], w[n];
  if (s[0] == '#') {
    b[0] = 1;
    w[0] = 0;
  } else {
    b[0] = 0;
    w[0] = 1;
  }
  for (int i = 1; i < n; i++) {
    if (s[i] == '#') {
      b[i] = b[i - 1] + 1;
      w[i] = w[i - 1];
    } else {
      b[i] = b[i - 1];
      w[i] = w[i - 1] + 1;
    }
  }
  int minans = w[n - 1];
  for (int i = 1; i < n; i++) {
    int bb = b[i];
    int ww = w[n - 1] - w[i];
    if (minans > bb + ww) minans = bb + ww;
  }
  cout << minans << endl;
}
