#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int ans1 = 0, ans2 = 0, ans3 = 0;
  int left = -1;
  int right = -1;
  int count = 0;
  int count2 = 0;
  bool flag = false;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      ans1++;
    }
    if (S[i] == '#') {
      ans2++;
    }
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') flag = true;
    if (flag) {
      if (S[i] == '.') {
        count++;
      }
    }
  }
  ans1 = min(ans1, ans2);
  ans1 = min(ans1, count);
  cout << ans1 << endl;
}
