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