#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 (s[i] == '#') break;
  }
  for (j = n - 1; j >= 0; j--)
    if (s[j] == '.') break;
  for (; i <= j; i++) {
    if (s[i] == '.') cnt[0]++;
    if (s[i] == '#') cnt[1]++;
  }
  cout << min(cnt[0], cnt[1]);
  return 0;
}
