#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, black = 0, sum, white = 0, minv = 200005;
  int j;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '.') ++white;
  }
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#') {
      ++black;
    } else
      --white;
    sum = white + black;
    minv = min(sum, minv);
  }
  cout << minv << endl;
  return 0;
}
