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