#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
int main() {
  ll N;
  cin >> N;
  string S;
  cin >> S;
  ll white = 0, black = 0;
  for (ll i = 0; i < N; i++) {
    if (S[i] == '.')
      white++;
    else
      black++;
  }
  ll ans2 = 0, ans3 = 0, ans4 = 0;
  bool last_white = false;
  bool first_black = false;
  for (ll i = N - 1; i >= 0; i--) {
    if (last_white) {
      if (S[i] == '#') ans3++;
    }
    if (!last_white) {
      if (S[i] == '.') last_white = true;
    }
  }
  for (ll i = 0; i < N; i++) {
    if (first_black) {
      if (S[i] == '.') ans4++;
    }
    if (!first_black) {
      if (S[i] == '#') first_black = true;
    }
  }
  ans2 = min(white, black);
  ans2 = min(ans2, ans3);
  ans2 = min(ans2, ans4);
  cout << ans2 << "\n";
  return 0;
}
