#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char s[n];
  for (int i = 0; i < n; i++) cin >> s[i];
  int split = 0;
  int sum = n;
  for (int i = 0; i < n; i++) {
    int white = 0;
    int black = 0;
    for (int j = 0; j <= split; j++) {
      if (s[j] == '.') white++;
    }
    for (int k = n - 1; k > split; k--) {
      if (s[k] == '#') black++;
    }
    if (sum > black + white) sum = black + white;
    split++;
  }
  cout << sum << endl;
  return 0;
}
