#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans = 99999999;
  int tmp_ans = 0;
  string tmp = "#.";
  int cnt1 = 0;
  int cnt2 = 0;
  int cnt;
  for (int i = 0; i < (int)(n); i++) {
    if (s[i] == tmp[0]) {
      cnt1++;
      cnt = i;
    } else
      cnt2++;
  }
  tmp_ans = n - cnt;
  ans = min(cnt1, min(cnt2, tmp_ans));
  cout << ans << endl;
}
