#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string S;
  cin >> N >> S;
  int N_rb;
  int N_aw;
  N_aw = 0;
  for (int i = 0; i < S.length(); i++) {
    if (S[i] == '#') {
      N_aw += 1;
    }
  }
  N_rb = 0;
  bool first_b = false;
  for (int i = 0; i < S.length(); i++) {
    if (S[i] == '#') {
      first_b = true;
    }
    if (S[i] == '.' && first_b) {
      N_rb += 1;
    }
  }
  cout << min(N_aw, N_rb) << endl;
  return 0;
}
