#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  string S;
  cin >> N >> S;
  vector<int> num(N);
  int sum = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') sum++;
    num[i] = sum;
  }
  int mini = 0;
  for (int i = 0; i < 0; i++) {
    int cnt = num[i] + (N - (num[N - 1] - num[i]));
    if (cnt < mini) {
      mini = cnt;
    }
  }
  cout << mini << endl;
  return 0;
}
