#include <bits/stdc++.h>
using namespace std;
int main() {
  ;
  int N;
  string S;
  cin >> N >> S;
  int count_s = 0;
  int count_d = 0;
  bool sharp = false;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#')
      count_s++;
    else
      count_d++;
  }
  if (S[0] == '#') {
    cout << min(count_d, count_s);
  } else {
    cout << min(count_d - 1, count_s);
  }
}
