#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  string S;
  cin >> N >> S;
  int blacknumber = 0, whitenumber = 0;
  for (int(i) = 0; (i) < (N); (i)++) {
    if (S[i] == '#') {
      blacknumber++;
    } else {
      whitenumber++;
    }
  }
  int tmp1 = 0, tmp2 = 0, ans = 0;
  int answer[N];
  for (int(i) = 0; (i) < (N); (i)++) answer[i] = 1000000;
  for (int(i) = 0; (i) < (N - 1); (i)++) {
    if (S[i] == '#' && S[i + 1] == '.') {
      tmp1 = 0, tmp2 = 0;
      for (int j = N - 1; j > i; j--) {
        if (S[j] == '.') tmp1++;
      }
      for (int(k) = 0; (k) < (i); (k)++) {
        if (S[k] == '#') tmp2++;
      }
      answer[i] = tmp1 + tmp2;
    }
  }
  sort(answer, answer + N);
  if (answer[0] < 1000000) {
    ans = answer[0];
  }
  ans = min(ans, blacknumber);
  ans = min(ans, whitenumber);
  cout << ans;
  return 0;
}
