#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int x = 0, y = 0;
  int sum1 = 0, sum2 = 0, sum3 = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      x++;
    }
    if (s[i] == '#') {
      y++;
    }
  }
  sum1 = n - x;
  sum2 = n - y;
  int right = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      right = i;
      break;
    }
  }
  for (int i = 0; i <= right; i++) {
    if (s[i] == '#') sum3++;
  }
  cout << min(sum1, min(sum2, sum3)) << endl;
}
