#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int cnt = 0;
  for (int i = 0; i < (n); i++) {
    if (s[i] == '#') cnt++;
  }
  int ans = 1000000;
  int Lw = 0, Lb = 0;
  for (int i = 0; i < (n); i++) {
    if (s[i] == '.')
      Lw++;
    else {
      int ansi = 0;
      ansi += Lb;
      ansi += (n - cnt) - Lw;
      ans = min(ans, ansi);
      Lb++;
    }
  }
  if (ans == 1000000) {
    cout << 0 << endl;
  } else {
    cout << ans << endl;
  }
}
