#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int bn, wn;
int bp, wp;
int ans;
int main() {
  cin >> n >> s;
  for (long long i = (long long)0; i < (long long)n; ++i) {
    if (s[i] == '#') {
      bp = i;
      break;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      wp = i;
      break;
    }
  }
  for (long long i = (long long)bp; i < (long long)wp + 1; ++i) {
    if (s[i] == '#')
      bn++;
    else
      wn++;
  }
  ans = min(bn, wn);
  cout << ans << endl;
  return 0;
}
