#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, 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;
    if (S[0] == '.') ans--;
  } else
    ans = kuro;
  cout << ans << '\n';
}
