#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int flag = 0;
  int count = 0;
  int count_w = 0;
  for (int i = 0; i < N; i++) {
    if (flag == 0 && S.at(i) == '#') {
      flag = 1;
    }
    if (flag == 1 && S.at(i)) {
      count++;
    }
  }
  flag = 0;
  for (int i = N - 1; i >= 0; i--) {
    if (flag == 0 && S.at(i) == '.') {
      flag = 1;
    }
    if (flag == 1 && S.at(i) == '#') {
      count_w++;
    }
  }
  cout << min(count, count_w) << endl;
}
