#include <bits/stdc++.h>
using namespace std;
int main() {
  int counter, i, n, counter2;
  string s, str;
  cin >> n;
  cin >> s;
  str = s;
  counter = 0;
  counter2 = 0;
  for (i = 0; i < n - 1; i++) {
    if (str[i] == '#') {
      if (str[i + 1] == '.') {
        str[i + 1] = '#';
        counter++;
      }
    }
  }
  for (i = n - 1; i > 0; i--) {
    if (s[i] == '.') {
      if (s[i - 1] == '#') {
        s[i - 1] = '.';
        counter2++;
      }
    }
  }
  if (counter2 < counter) {
    counter = counter2;
  }
  cout << counter << endl;
}
