#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using p_ll = pair<ll, ll>;
int main() {
  ll N, white = 0, black = 0, black2 = 0;
  cin >> N;
  bool b = false, w = false;
  ll firstB = 0, lastW = 0;
  vector<char> S(N);
  for (ll i = 0; i < N; ++i) {
    cin >> S[i];
    if (!b && S[i] == '#') {
      b = true;
      firstB = i;
    }
    if (S[i] == '.') lastW = i;
  }
  for (ll i = 0; i < N; ++i) {
    if (i >= firstB && S[i] == '.') white++;
    if (i <= lastW && S[i] == '#') black++;
  }
  cout << min(black, white) << endl;
  cin >> N;
}
