#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int cnt1 = 0, cnt2 = 0;
  bool bla = true;
  for (int i = S.length() - 1; i >= 0; i--) {
    if (S[i] == '.') {
      bla = false;
      cnt1++;
    }
    if (!bla && S[i] == '#') {
      cnt2++;
    }
  }
  cout << min(cnt1, cnt2) << endl;
  getchar();
  getchar();
  return 0;
}
