#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  vector<int> a;
  vector<int> b;
  char flag = S[0];
  int count;
  for (int i = 0; i < N; i++) {
    count = 0;
    while (S[i] == flag) {
      i++;
      count++;
    }
    a.push_back(count);
    flag = S[i];
    i--;
  }
  int sum = 0;
  if (S[0] == '#') {
    for (int i = 1; i < a.size(); i += 2) {
      sum += a[i];
    }
  } else {
    for (int i = 0; i < a.size(); i += 2) {
      sum += a[i];
    }
  }
  b.push_back(sum);
  if (S[0] == '#' && a.size() % 2 == 0) {
    for (int i = 0; i < a.size(); i += 2) {
      sum = sum + a[i];
      sum = sum - a[i + 1];
      b.push_back(sum);
    }
  } else if (S[0] == '#') {
    for (int i = 0; i < a.size(); i += 2) {
      sum = sum + a[i];
      sum = sum - a[i + 1];
      b.push_back(sum);
    }
    sum -= a[a.size() - 1];
    b.push_back(sum);
  } else if (S[0] == '.' && a.size() % 2 == 1) {
    sum -= 1;
    for (int i = 1; i < a.size(); i += 2) {
      sum += a[i];
      sum -= a[i + 1];
      b.push_back(sum);
    }
  } else {
    sum -= 1;
    for (int i = 1; i < a.size(); i += 2) {
      sum += a[i];
      sum -= a[i + 1];
      b.push_back(sum);
    }
    sum += a[a.size() - 1];
    b.push_back(sum);
  }
  sort(b.begin(), b.end());
  cout << b[0] << endl;
  return 0;
}
