#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, black = 0, white = 0, head = 0, tale = 0, sum = 0;
  string S;
  cin >> N >> S;
  while (S[head] == '.' && head < N) head++;
  tale = N - 1;
  while (S[tale] == '#' && tale >= 0) tale--;
  for (int(i) = (head); (i) < (N); ++(i)) {
    if (S[i] == '.') white++;
  }
  for (int(i) = (0); (i) < (tale + 1); ++(i)) {
    if (S[i] == '#') black++;
  }
  cout << (((white) < (black)) ? (white) : (black)) << endl;
  return 0;
}
