#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
int main() {
  int N, count = 0, count2 = 0;
  char prev, curr, stone[2 * 100000];
  cin >> N;
  cin >> prev;
  stone[0] = prev;
  for (int i = 0; i < N - 1; i++) {
    cin >> curr;
    stone[i + 1] = curr;
    if (prev == '#' && curr == '.') {
      count++;
      curr = '#';
    }
    prev = curr;
  }
  prev = stone[N - 1];
  for (int i = N - 2; i >= 0; i--) {
    curr = stone[i];
    if (prev == '.' && curr == '#') {
      count2++;
      curr = '.';
    }
    prev = curr;
  }
  if (count2 < count) count = count2;
  cout << count;
}
