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