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