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