#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> data(N);
  int count = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#') count++;
    data.at(i) = count;
  }
  int ans = 100000000, a;
  for (int i = 0; i < N; i++) {
    if (i != N - 1)
      a = data.at(i) + (N - i - 1 - (data.at(N - 1) - data.at(i)));
    else
      a = data.at(i);
    ans = min(ans, a);
  }
  cout << ans << endl;
  return 0;
}
