#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  string S;
  cin >> N >> S;
  long long firstBlack(-1);
  vector<long long> cnt(3, 0);
  for (long long i(0); i < N; ++i) {
    if (S[i] == '#')
      cnt[0]++;
    else
      cnt[1]++;
    if (firstBlack == -1 && S[i] == '#') firstBlack = i;
    if (firstBlack != -1 && S[i] == '.') cnt[2]++;
  }
  sort(cnt.begin(), cnt.end());
  cout << cnt[0] << endl;
  return 0;
}
