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