#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  string S;
  cin >> N >> S;
  bool black_exists(false);
  long long b_cnt(1), w_cnt(0);
  for (long long i(0); i < N; ++i) {
    if (S[i] == '#') black_exists = true;
    if (black_exists) {
      if (S[i] == '.')
        w_cnt++;
      else
        b_cnt++;
    }
  }
  if (black_exists) {
    long long i(N - 1);
    while (S[i] == '#') {
      --i;
      --b_cnt;
    }
  }
  if (b_cnt < w_cnt)
    cout << b_cnt << endl;
  else
    cout << w_cnt << endl;
  return 0;
}
