#include <bits/stdc++.h>
using namespace std;
long long int i, j, n, m, k, l, q, t, a, b, sum[3], tot[3], cnt[3];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s1 = "#.", s2 = ".#", s;
  cin >> n;
  cin >> s;
  bool flag = 0;
  for (i = 0; i < n; i++) {
    if (flag) {
      if (s[i] == '.') cnt[0]++;
    }
    if (s[i] == '#') {
      cnt[1]++;
      flag = 1;
    }
  }
  cout << min(cnt[0], cnt[1]);
  return 0;
}
