#include <bits/stdc++.h>
using namespace std;
long long n, b = 0, w = 0, cnt = 0, cntb;
long long ans[4];
bool bl = false, wh = false;
string s;
signed main() {
  cin >> n >> s;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '.')
      w++;
    else
      b++;
    if (s[i] == '#') bl = true;
    if (bl == true && s[i] == '.') cnt++;
  }
  for (long long i = n - 1; i >= 0; i--) {
    if (s[i] == '.') wh = true;
    if (wh == true && s[i] == '#') cntb++;
  }
  ans[0] = w;
  ans[1] = b;
  ans[2] = cnt;
  ans[3] = cntb;
  sort(ans, ans + 4);
  cout << ans[0] << endl;
  return 0;
}
