#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int b = 0, w = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '.') w++;
  }
  int ans = 10000000;
  for (int i = 0; i < N; i++) {
    int sum = 0;
    if (S.at(i) == '#') {
      b++;
    } else
      w--;
    sum += b + w;
    ans = min(ans, sum);
  }
  cout << ans << endl;
}
