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