#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int count = 0;
  int count_w = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#' && i != N - 1) {
      if (S.at(i + 1) == '.') {
        S.at(i + 1) = '#';
        count++;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#') {
      S.at(i) = '.';
      count_w++;
    }
  }
  cout << min(count, count_w) << endl;
}
