#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, ans;
  string S;
  cin >> N >> S;
  long long ans1 = 0, ans2 = 0, ans3 = 0;
  for (long long i = 0; i < N; i++) {
    if (S[i] == '#') ans1++;
  }
  for (long long i = 0; i < N; i++) {
    if (S[i] == '.') ans2++;
  }
  int type = 0;
  for (long long i = 0; i < N; i++) {
    if (S[i] == '#') {
      if (type == 0) type = 1;
    } else if (type == 1) {
      type = 2;
      ans3++;
    } else if (type == 2) {
      ans3++;
    } else {
    }
  }
  cout << min(min(ans1, ans2), ans3) << endl;
  return 0;
}
