#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<char> S(N);
  for (int i = 0; i < N; i++) {
    cin >> S[i];
  }
  int count_white = 0;
  int count_black = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.')
      count_white++;
    else
      count_black++;
  }
  int count = 0;
  if (S[0] == '#') {
    S[0] = '.';
    count++;
  }
  if (S[N - 1] == '.') {
    S[N - 1] = '#';
    count++;
  }
  for (int i = 1; i < N; i++) {
    for (int j = 0; j < i; j++) {
      if (S[j] != '.') {
        S[j] = '.';
        count++;
      }
    }
    for (int j = i; j < N - 1; j++) {
      if (S[j] != '#') {
        S[j] = '#';
        count++;
      }
    }
  }
  cout << min(count, min(count_white, count_black)) << endl;
}
