#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, min = 2000000;
  string s;
  cin >> n >> s;
  int bc = 0, wc = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '.') {
      bc++;
    }
  }
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '#') {
      wc++;
    } else {
      if (i != 0) bc--;
    }
    if (min > wc + bc) {
      min = bc + wc;
    }
  }
  cout << min << endl;
  return 0;
}
