#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int wtot = 0;
  for (size_t i = 0; i < (N); ++i) {
    if ('.' == S[i]) {
      ++wtot;
    }
  }
  int btot = N - wtot;
  int ans = min(wtot, btot);
  int cnt = 0;
  for (int i = 0; i < wtot; ++i) {
    if ('#' == S[i]) {
      ++cnt;
    }
  }
  for (int i = wtot; i < N; ++i) {
    if ('.' == S[i]) {
      ++cnt;
    }
  }
  ans = min(ans, cnt);
  cout << ans << endl;
  return 0;
}
