#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int ans = N;
  int* white = new int[N];
  int* black = new int[N];
  white[0] = 0;
  black[0] = 0;
  if (S[0] == '.') {
    white[0] = 1;
  } else {
    black[0] = 1;
  }
  for (int i = 1; i < N; i++) {
    white[i] = white[i - 1];
    black[i] = black[i - 1];
    if (S[i] == '.') {
      white[i]++;
    } else {
      black[i]++;
    }
  }
  int change;
  for (int i = 0; i < N; i++) {
    change = white[N - 1] - white[i] + black[i] - black[0];
    if (S[0] == '#' && white[N - 1] != 0) {
      change++;
    }
    if (ans > change) {
      ans = change;
    }
  }
  cout << ans << flush;
  delete[] white;
  delete[] black;
}
