#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long N;
  cin >> N;
  string S;
  cin >> S;
  long long cnt1 = 0;
  bool mode = false;
  for (auto &x : S) {
    if (x == '.') {
      if (mode) {
        cnt1++;
      }
    } else {
      mode = true;
    }
  }
  reverse((S).begin(), (S).end());
  long long cnt2 = 0;
  mode = false;
  for (auto &x : S) {
    if (x == '#') {
      if (mode) {
        cnt2++;
      }
    } else {
      mode = true;
    }
  }
  cout << min(cnt1, cnt2) << endl;
}
signed main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  solve();
}
