#include <bits/stdc++.h>
using namespace std;
int main() {
  int i = 0, j = 0, N, K, kuro = 0, ans_siro = 0, siro = 0, ans_kuro = 0;
  string S, T;
  char k;
  cin >> N >> S;
  for (i = 0; i < N; i++) {
    if (S[i] == '#')
      kuro++;
    else
      siro++;
  }
  ans_siro = siro;
  i = 0;
  while (j == 0) {
    if (S[i] == '.')
      ans_siro--;
    else
      j = 1;
    i++;
  }
  j = 0;
  ans_kuro = kuro;
  i = 0;
  while (j == 0) {
    if (S[N - 1 - i] == '#')
      ans_kuro--;
    else
      j = 1;
    i++;
  }
  cout << min(ans_siro, ans_kuro) << '\n';
}
