#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int white = 0;
  for (int i = 1; i < N; i++) {
    if (S[i] == '.') {
      white++;
    }
  }
  int black = N - white;
  int ans = min(white, black);
  int right_white = white;
  int left_black = 0;
  for (int i = 0; i < N; i++) {
    ans = min(ans, right_white + left_black);
    if (S[i] == '#') {
      left_black++;
    } else {
      right_white--;
    }
  }
  cout << ans << endl;
}
