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