#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  char *A = new char[200010];
  char *B = new char[200010];
  for (int i = 1; i <= N; i++) {
    cin >> A[i];
    B[i] = A[i];
  }
  int count1 = 0;
  for (int i = 1; i < N; i++) {
    if (A[i] == '#' && A[i + 1] == '.') {
      A[i + 1] = '#';
      count1++;
    }
  }
  int count2 = 0;
  for (int i = N; i > 1; i--) {
    if (B[i] == '.' && B[i - 1] == '#') {
      B[i - 1] = '.';
      count2++;
    }
  }
  if (count1 < count2) {
    cout << count1;
  } else {
    cout << count2;
  }
  delete[] A;
  delete[] B;
  return 0;
}
