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