#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int ans = 100000000;
  int c1 = 0;
  if (S[N - 1] == '#') ++c1;
  for (int i = 0; i < (N - 1); ++i) {
    if (S[i] == '#') {
      ++c1;
    }
  }
  ans = min(ans, c1);
  int c2 = 0;
  if (S[N - 1] == '.') ++c2;
  for (int i = 0; i < (N - 1); ++i) {
    if (S[i] == '.') {
      ++c2;
    }
  }
  ans = min(ans, c2);
  int c3 = 0;
  if (S[N - 1] == '.') ++c3;
  for (int i = 0; i < (N - 1); ++i) {
    if (S[i] == '#') {
      ++c3;
    }
  }
  ans = min(ans, c3);
  cout << ans << endl;
  return 0;
}
