#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  int ans, min = 1000000;
  string s;
  cin >> N >> s;
  long long sum1[200000], sum2[200000];
  for (long long 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; i++) {
    ans = sum1[i - 1] + sum2[N - 2] - sum2[i - 2];
    if (min > ans) {
      min = ans;
    }
  }
  cout << ans << endl;
  return 0;
}
