#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  string S;
  cin >> N >> S;
  
  int flag = -1;
  int A[N] = { 0 };
  for (int i = 0; i < N; ++i) {
    if (flag == -1 && S[i] == '#') {
      flag = i;
      A[i] = 1;
    } else if (flag > -1) {
      A[i] = 1;
    } else {
      A[i] = 0;
    }
  }

  int c1 = 0, c2 = 0;
  for (int i = flag; i < N; ++i) {
    if (S[i] == '#' && A[i] == 1) {
      c1++;
    } else {
      c2++;
    }
  }

  cout << min(c1, c2) << endl;
}