#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<char> s;
  s.resize(N);
  int a = 0;
  for (int i = 0; i < N; i++)
    if (S[i] == '#') {
      a += 1;
      for (int j = i; j < N; j |= j + 1) s[j] += 1;
    }
  int min = 2 * 10e5;
  int l, r;
  for (int i = -1; i < N; i++) {
    l = 0;
    r = 0;
    if (i >= 0)
      for (int j = i; j >= 0; j = (j & (j + 1)) - 1) l += s[j];
    r = (N - i - 1) - (a - l);
    if (min > r + l) min = r + l;
  }
  cout << min << endl;
  return 0;
}
