#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int len = S.length();
  int toBlack = -1;
  for (int i = 0; i < (int)(len); i++) {
    char c = S[i];
    if (toBlack < 0) {
      if (c == '#') {
        toBlack = 0;
      }
    } else {
      if (c == '.') {
        toBlack += 1;
      }
    }
  }
  int toWhite = -1;
  for (int i = len - 1; i >= 0; i--) {
    char c = S[i];
    if (toWhite < 0) {
      if (c == '.') {
        toWhite = 0;
      }
    } else {
      if (c == '#') {
        toWhite += 1;
      }
    }
  }
  int ans = 0;
  if (toWhite >= 0 && toBlack >= 0) {
    ans = min(toBlack, toWhite);
  } else if (toBlack >= 0) {
    ans = toBlack;
  } else if (toWhite >= 0) {
    ans = toWhite;
  }
  cout << ans << endl;
  return 0;
}
