#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  string S;
  cin >> N;
  cin >> S;
  long long sharp = 0;
  long long dot = 0;
  vector<long long> sharps(0), dots(0);
  for (long long i = 0; i < N; i++) {
    if (S[i] == '#') {
      ++sharp;
    } else {
      ++dot;
    }
    sharps.push_back(sharp);
    dots.push_back(dot);
  }
  long long temp_min = 100000;
  for (long long i = 0; i < N; i++) {
    long long temp = sharps[i] + dot - dots[i];
    temp_min = min(temp, temp_min);
  }
  cout << temp_min << endl;
}
