#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n;
  string s;
  cin >> n;
  cin >> s;
  long long count1 = 0;
  string tmp = s;
  for (long long i = 1; i < n; i++) {
    if (tmp[i] == '.' && tmp[i - 1] == '#') {
      tmp[i] = '#';
      count1++;
    }
  }
  long long count2 = 0;
  tmp = s;
  for (long long i = n - 1; i >= 1; i--) {
    if (tmp[i] == '.' && tmp[i - 1] == '#') {
      tmp[i] = '.';
      count2++;
    }
  }
  cout << min(count1, count2) << endl;
}
