#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int c1 = 0, c2 = 0, c3 = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') c1++;
  }
  bool st = false;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') st = true;
    if (s[i] == '#' && st) c2++;
  }
  bool start = false;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') start = true;
    if (start) {
      if (s[i] == '.') c3++;
    }
  }
  cout << min({c1, c2, c3}) << endl;
}
