#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long N, wcou, ans1, ans2, bcou;
  bcou = 0;
  ans1 = 0;
  ans2 = 0;
  wcou = 0;
  string S, s;
  long long b = 0;
  cin >> N >> S;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') b = 1;
    if (b == 1 && S[i] == '.') wcou++;
    if (b == 1 && S[i] == '#') bcou++;
  }
  cout << min(wcou, bcou) << endl;
}
