#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  scanf("%d", &N);
  string S;
  cin >> S;
  int counta = 0;
  int countb = 0;
  int countc = 0;
  int max = N;
  for (int i = 0; i < N; ++i) {
    if (S[i] == '#') ++counta;
  }
  for (int i = 0; i < N; ++i) {
    if (S[i] == '.') ++countb;
  }
  if (counta < max) max = counta;
  if (countb < max) max = countb;
  for (int i = 0; i < N; ++i) {
    if (S[i] == '#')
      --counta;
    else
      ++counta;
    if (counta < max) max = counta;
  }
  cout << max << endl;
}
