#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int ans, min = 200000;
  string s;
  cin >> N >> s;
  int sum1[200000], sum2[200000];
  vector<int> x(N, 0);
  for (int i = 0; i < N; i++) {
    if (s[i] == '#') {
      sum1[i + 1] = sum1[i] + 1;
      sum2[i + 1] = sum2[i];
    }
    if (s[i] == '.') {
      sum2[i + 1] = sum2[i] + 1;
      sum1[i + 1] = sum1[i];
    }
  }
  for (int i = 0; i < N + 1; i++) {
    x[i] = sum1[i] + sum2[N] - sum2[i];
  }
  sort(x.begin(), x.end());
  cout << x[0] << endl;
  return 0;
}
