#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char s[200000];
  cin >> n >> s;
  int cntO = 0;
  int temp = 0;
  int temppos = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      cntO++;
      if (cntO > (i + 1) / 2) {
        temppos = i;
        temp = i - cntO + 1;
      }
    }
  }
  int cntI = 0;
  for (int i = temppos + 1; i < n; i++) {
    if (s[i] == '#') cntI++;
  }
  if (temppos == 0)
    cout << cntO;
  else
    cout << temp + cntI;
  return 0;
}
