#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int i = 0, j = s.size() - 1;
  while (s[i] == '.' && i < s.size()) {
    i++;
  }
  while (s[j] == '#' && j >= 0) {
    j--;
  }
  vector<int> w, b;
  for (int k = i; k <= j; k++) {
    int count = 0;
    while (s[k] == '#' && k <= j) {
      k++;
      count++;
    }
    b.push_back(count);
    count = 0;
    while (s[k] == '.' && k <= j) {
      k++;
      count++;
    }
    w.push_back(count);
  }
  int ans = 2000000;
  for (int d = 0; d <= b.size(); d++) {
    int c = 0;
    for (int e = 0; e < d; e++) {
      c += b[e];
    }
    for (int f = d; f < w.size(); f++) {
      c += w[f];
    }
    ans = min(ans, c);
  }
  cout << ans << endl;
}
