#include <bits/stdc++.h>
using namespace std;
int main() {
  long n;
  string s;
  cin >> n >> s;
  long count = 0;
  vector<long> v;
  vector<long> accumSum;
  for (long i = 0; i < n; i++) {
    if (s[i] == '#') {
      count++;
      if (i != n && s[i + 1] == '.') {
        v.push_back(i);
      }
    } else if (s[i] == '.') {
      if (i != n && s[i + 1] == '#') {
        v.push_back(i);
      }
    }
    accumSum.push_back(count);
  }
  count = min(count, n - count);
  long minCount = 10e6;
  for (auto &&x : v) {
    long a = (accumSum[x] - accumSum[0] + 1) + (n - x) -
             (accumSum[n - 1] - accumSum[x + 1] + 1);
    minCount = min(a, minCount);
  }
  cout << min(count, minCount) << "\n";
}
