#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> black(N + 1, 0), white(N + 1, 0);
  for (int i = 1; i <= N; i++) {
    if (S[i - 1] == '#')
      black[i] = black[i - 1] + 1;
    else
      black[i] = black[i - 1];
  }
  for (int i = N - 2; i >= -1; i--) {
    if (S[i + 1] == '.')
      white[i + 1] = white[i + 2] + 1;
    else
      white[i + 1] = white[i + 2];
  }
  for (int i = 1; i < N + 1; i++) {
    black[i] += white[i];
  }
  sort(black.begin(), black.end());
  cout << black[1] << endl;
  return 0;
}
