#include <bits/stdc++.h>
using namespace std;
signed main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int min_black;
  min_black = -1;
  int max_white;
  max_white = -1;
  for (int i = 0; i < N; i++) {
    if (min_black < 0) {
      if (S[i] == '#') min_black = i;
    }
    if (S[i] == '.') max_white = i;
  }
  if (min_black < 0 || max_white < 0 || min_black > max_white) {
    cout << 0 << endl;
    return 0;
  } else {
    int count_black;
    count_black = 0;
    for (int i = min_black; i <= max_white; i++) {
      if (S[i] == '#') count_black++;
    }
    int ans;
    ans = min(count_black, max_white - min_black + 1 - count_black);
    cout << ans << endl;
    return 0;
  }
}
