#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int i = 0;
  int ans = 0;
  cin >> n;
  char s[200000];
  for (i = 0; i < n; i++) {
    cin >> s[i];
  }
  int kioku;
  for (i = 0; i < n; i++) {
    if (s[i] == '#') {
      break;
    }
  }
  int cnt = 0;
  int sirooboe = 0;
  for (i; i < n; i++) {
    if (s[i] == '.') {
      cnt++;
    }
  }
  int cntl = 0;
  for (i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      break;
    }
  }
  sirooboe = i;
  for (i = 0; i <= sirooboe; i++) {
    if (s[i] == '#') cntl++;
  }
  if (cntl <= cnt) {
    ans = cntl;
  } else {
    ans = cnt;
  }
  cout << ans;
}
