#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int counter = 0;
  string SS;
  SS = S;
  for (int i = N; i > 0; i--) {
    if (S[i] == (char)'.' && S[i - 1] == (char)'#') {
      S[i - 1] = (char)'.';
      counter++;
    }
  }
  int answer = counter;
  counter = 0;
  for (int i = 0; i < N; i++) {
    if (SS[i] == (char)'#' && SS[i + 1] == (char)'.') {
      SS[i + 1] = (char)'#';
      counter++;
    }
  }
  if (!counter == 0) answer = min(counter, answer);
  cout << answer << endl;
  return 0;
}
