#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  string S;
  cin >> N >> S;
  bool black_flag = false;
  if (S[0] == '#') black_flag = true;
  int continuous_counter = 0;
  vector<int> white, black;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#' && black_flag) {
      continuous_counter++;
    } else if (S[i] == '.' && !black_flag) {
      continuous_counter++;
    } else if (S[i] == '#' && !black_flag) {
      white.push_back(continuous_counter);
      continuous_counter = 1;
      black_flag = true;
    } else {
      black.push_back(continuous_counter);
      continuous_counter = 1;
      black_flag = false;
    }
  }
  if (black_flag) {
    black.push_back(continuous_counter);
  } else {
    white.push_back(continuous_counter);
  }
  int min_change = N;
  int counter = 0;
  for (int i = 0; i < white.size() + 1; i++) {
    if (i == 0) {
      counter = accumulate(white.begin() + i, white.end(), 0);
    } else if (i != white.size()) {
      counter = accumulate(white.begin() + i, white.end(), 0) +
                accumulate(black.begin(), black.end() + i, 0);
    } else {
      counter = accumulate(black.begin(), black.end(), 0);
    }
    if (counter < min_change) min_change = counter;
    counter = 0;
  }
  cout << min_change << '\n';
  return 0;
}
