#include <bits/stdc++.h>
using namespace std;
int main() {
  long N, count = 0;
  long index, c2 = 0, c3 = 0;
  long in2 = -1;
  string str;
  cin >> N >> str;
  index = N;
  for (long i = 0; i < N; i++) {
    if (str[i] == '#') {
      index = i;
      break;
    }
  }
  for (long i = index + 1; i < N; i++) {
    if (str[i] == '.') {
      count++;
    } else {
      c2++;
    }
  }
  for (long i = N - 1; i >= 0; i--) {
    if (str[i] == '.') {
      in2 = i;
      break;
    }
  }
  for (long i = in2 - 1; i >= 0; i--) {
    if (str[i] != '.') {
      c3++;
    }
  }
  if (1 + c2 > count) {
    if (count < c3) {
      cout << count;
    } else {
      cout << c3;
    }
  } else {
    if (1 + c2 < c3) {
      cout << 1 + c2 << endl;
    } else {
      cout << c3;
    }
  }
  return 0;
}
