#include <bits/stdc++.h>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;
using std::string;
using ll = long long;
using pint = std::pair<int, int>;
using pll = std::pair<ll, ll>;
using std::vector;
int main() {
  int N;
  string S;
  cin >> N >> S;
  char b = '!';
  int c = 0;
  for (int i = (0), i_end_ = (N); i < i_end_; i++) {
    if (S[i] == '#' && b == '.') {
      c = std::max(c, std::max(i, N - i));
    }
    b = S[i];
  }
  if (c == 0) {
    cout << 0 << endl;
    return 0;
  }
  int cnt = 0;
  for (int i = (0), i_end_ = (c); i < i_end_; i++) {
    if (S[i] == '#') cnt++;
  }
  for (int i = (c), i_end_ = (N); i < i_end_; i++) {
    if (S[i] == '.') cnt++;
  }
  cout << std::min(cnt, N - cnt) << endl;
  return 0;
}
