#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, i, a = 0, b = 0, kuro = 0, siro = 0;
  string S;
  cin >> N >> S;
  for (i = 0; i < N; i++) {
    if (S[i] == '.') siro += 1;
    if (S[i] == '#') kuro += 1;
  }
  for (i = N - 1; i >= 0; i--) {
    if (S[i] == '.') break;
    a += 1;
  }
  for (i = 0; i < N; i++) {
    if (S[i] == '#') break;
    b += 1;
  }
  a = kuro - a;
  b = siro - b;
  if (a < b)
    cout << a;
  else
    cout << b;
  return 0;
}
