#include <bits/stdc++.h>
using namespace std;
int n, b, w, cnt[200002], minf = 1e9;
string s;
int main() {
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') w++;
  }
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      cnt[0] = w;
      continue;
    }
    if (s[i - 1] == '#')
      b++;
    else
      w--;
    cnt[i] = w + b;
    if (minf > cnt[i]) minf = cnt[i];
  }
  cout << minf << endl;
}
