#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1 << 30;
const int MOD = 1e9 + 7;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int black = 0, white = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '.')
      white++;
    else
      black++;
  }
  int ans = min(n - white, n - black);
  string t = "";
  while (white--) t += '.';
  while (black--) t += '#';
  int cnt = 0;
  for (int i = 0; i < t.size(); i++) {
    if (s[i] != t[i]) cnt++;
  }
  ans = min(ans, cnt);
  cout << ans << endl;
  return 0;
}
