#include <bits/stdc++.h>
using namespace std;
int ans = INT_MAX;
int N;
string S;
void bin(int left, int right) {
  int check = (left + right) / 2;
  int res = 0;
  for (int x = 0; x < (N); x++) {
    if (x < check) {
      if (S.at(x) == '#') {
        res++;
      }
    } else {
      if (S.at(x) == '.') {
        res++;
      }
    }
  }
  if (ans > res) {
    ans = min(ans, res);
    if (right - check > 1) {
      bin(check, right);
    }
  } else {
    if (check - left > 1) {
      bin(left, check);
    }
  }
}
void bin2(int left, int right) {
  int check = (left + right) / 2;
  int res = 0;
  for (int x = 0; x < (N); x++) {
    if (x < check) {
      if (S.at(x) == '#') {
        res++;
      }
    } else {
      if (S.at(x) == '.') {
        res++;
      }
    }
  }
  if (ans > res) {
    ans = min(ans, res);
    if (check - left > 1) {
      bin(left, check);
    }
  } else {
    if (right - check > 1) {
      bin(check, right);
    }
  }
}
int main() {
  cin >> N >> S;
  bin(0, N);
  bin2(0, N);
  bin(0, 0);
  bin(N, N);
  cout << ans << endl;
}
