#include <bits/stdc++.h>
using namespace std;
int N;
char S[110000];
int main() {
  cin >> N;
  for (int i = 0; i < N; ++i) cin >> S[i];
  int k;
  int b = 0;
  int w = 0;
  for (int i = 0; i < N; ++i) {
    if (S[i] == '#') {
      k = i;
      break;
    }
    if (i == N - 1) k = N;
  }
  for (int i = k; i < N; ++i) {
    if (S[i] == '#')
      ++w;
    else
      ++b;
  }
  if (k == N)
    cout << 0 << endl;
  else
    cout << min(b, w) << endl;
}
