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