#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  int min_sum = 2 * 10e5 + 1;
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; i++) {
    int sum = 0;
    for (int k = 0; k < n; k++) {
      string t(1, s[i]);
      if (i <= k) {
        if (t == "#") {
          sum += 1;
        }
      } else {
        if (t == ".") {
          sum += 1;
        }
      }
    }
    if (sum < min_sum) {
      min_sum = sum;
    }
  }
  cout << min_sum << endl;
  return 0;
}
