#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int ans = 0;
  int cnt = 0;
  int cnt1 = 0;
  int cnt2 = 0;
  bool flag;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      cnt++;
    } else {
      cnt1 += cnt;
      cnt = 0;
    }
  }
  cnt = 0;
  for (int i = N - 1; i >= 0; i--) {
    if (S[i] == '.') {
      cnt++;
    } else {
      cnt2 += cnt;
      cnt = 0;
    }
  }
  ans = min(cnt1, cnt2);
  cout << ans << endl;
}
