#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int l = 0, r = N - 1;
  while (S[l] == '.') l++;
  while (S[r] == '#') r--;
  if (r < l) {
    cout << 0 << endl;
    return 0;
  }
  string subs = S.substr(l, r - l + 1);
  cout << min(count((subs).begin(), (subs).end(), '.'),
              count((subs).begin(), (subs).end(), '#'))
       << endl;
}
