#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N;
  cin >> N;
  string str;
  cin >> str;
  long long ca = 0, cb = 0;
  long long a = 0;
  long long _min = 2 * 100000;
  vector<int> arr;
  char tmp = '.';
  int countwh = 0;
  int count = 0;
  arr.push_back(0);
  for (int i = 0; i < N; i++) {
    if (str[i] == tmp) {
      count++;
    } else {
      arr.push_back(count);
      count = 1;
      tmp = str[i];
    }
  }
  arr.push_back(count);
  if (str[N - 1] == '#') arr.push_back(0);
  for (int i = 1; i < arr.size() + 2; i = i + 2) {
    countwh += arr[i];
  }
  count = countwh;
  int mi = 100000;
  for (int i = 0; i < arr.size(); i = i + 2) {
    count += arr[i];
    count -= arr[i + 1];
    mi = min(count, mi);
  }
  cout << mi << endl;
  return 0;
}
