#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int start;
  for (start = 0; start < S.size(); ++start) {
    if (S[start] == '#') {
      break;
    }
  }
  int cnt1 = 0;
  int cnt2 = 0;
  for (int i = start; i < S.size(); ++i) {
    if (S[i] != '#') {
      ++cnt1;
    }
    if (S[i] != '.') {
      ++cnt2;
    }
  }
  int ans;
  ans = min(cnt1, cnt2);
  cout << ans << endl;
}
