#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int start = 0, end = N;
  for (int i = 0; i < N; i++)
    if (S[i] == '.') start++;
  for (int i = N - 1; i >= 0; i--)
    if (S[i] == '#')
      end--;
    else
      break;
  int sum_white = 0, sum_black = 0;
  for (int i = start; i < end; i++) {
    if (S[i] != '.') sum_white++;
    if (S[i] != '#') sum_black++;
  }
  cout << min(sum_white, sum_black) << endl;
}
