#include <bits/stdc++.h>
using namespace std;
const int INF = 10000000;
int main(int argc, char *argv[]) {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int ans1 = 0, ans2 = 0;
  int i = 0;
  for (; i < N; i++) {
    if (S[i] == '#') break;
  }
  int j = N - 1;
  for (; j >= 0; j--) {
    if (S[j] == '.') break;
  }
  int b = 0, w = 0;
  for (; i <= j; i++) {
    if (S[i] == '.') {
      b++;
    } else {
      w++;
    }
  }
  cout << min(b, w) << endl;
  return 0;
}
