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