#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, j, min = 10000000, tmp;
  string s;
  cin >> n >> s;
  vector<pair<long long, long long>> a(n);
  for (i = 0; i < n; i++) {
    if (i != 0) {
      a[i].first = a[i - 1].first;
      a[i].second = a[i - 1].second;
    }
    if (s[i] == '#') {
      a[i].first++;
    } else {
      a[i].second++;
    }
  }
  for (i = 0; i < n; i++) {
    tmp = 0;
    if (s[i] == '#') {
      if (i == n - 1) {
        tmp = a[n - 2].second;
      } else if (i == 0) {
        tmp = a[n - 1].second;
      } else {
        tmp = a[i].first + a[n - 1].second - a[i].second;
      }
      if (tmp < min) {
        min = tmp;
      }
    }
  }
  cout << min << endl;
}
