#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using Graph = vector<vector<int>>;
using Graphw = vector<vector<pair<ll, ll>>>;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int black = 0, blacktem = 0, white = 0;
  bool swit = false;
  for (ll i = 0; i < (ll)(N); i++) {
    if (swit) {
      if (S[i] == '#') {
        blacktem++;
      } else {
        black += blacktem;
        blacktem = 0;
        white++;
      }
    } else {
      if (S[i] == '#') swit = true;
      blacktem++;
    }
  }
  int ans;
  if (white < black) {
    ans = white;
  } else {
    ans = black;
  }
  cout << ans << endl;
  return 0;
}
