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