#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  bool flip_to_white = false, flip_to_black = false;
  int fliped_to_white = 0, fliped_to_black = 0;
  for (int i = (int)(1); i <= (int)(N - 1); i++) {
    int j = N - 1 - i;
    if (S[i] == '.' && S[i - 1] == '#') flip_to_black = true;
    if (S[j] == '#' && S[j + 1] == '.') flip_to_white = true;
    if (flip_to_black && S[i] == '.') {
      fliped_to_black++;
    }
    if (flip_to_white && S[i] == '#') {
      fliped_to_white++;
    }
  }
  cout << min(fliped_to_white, fliped_to_black) << endl;
}
