#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int white[N + 1], black[N + 1], cnt = 0;
  white[0] = 0;
  for (int i = 1; i < N + 1; ++i) {
    if (S[i] == '#') cnt++;
    white[i] = cnt;
  }
  cnt = 0;
  for (int i = N - 1; i >= 0; --i) {
    if (S[i] == '.') cnt++;
    black[i] = cnt;
  }
  black[N] = 0;
  cnt = N + 1;
  for (int j = N; j >= 0; --j) {
    cnt = min(cnt, white[j] + black[j]);
  }
  cout << cnt << "\n";
  return 0;
}
