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