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