#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int w = 0, b = 0, ans;
  string s;
  cin >> n >> s;
  ans = n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; i++) {
      if (j < i && s[i] == '#') {
        w++;
      } else if (s[i] == '.') {
        b++;
      }
    }
    if (w + b < ans) {
      ans = w + b;
      w = 0;
      b = 0;
    }
  }
  cout << ans << endl;
  return 0;
}
