#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
int main() {
  int N, w = 0, b = 0, r;
  string S;
  cin >> N >> S;
  for (int i = 0; i < (N); ++i) w += S.at(i) == '.';
  for (int i = 0; i < (N); ++i) {
    r = min(r, w + b);
    b += S.at(i) == '#';
    w -= S.at(i) == '.';
  }
  cout << min(r, w + b) << endl;
}
