#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, B = 0, W = 0, i = 0, j;
  string S;
  cin >> N >> S;
  while (S[i] != '#' && i < N - 1) {
    i++;
  }
  j = N - 1;
  while (S[j] != '.' && j > 0) {
    j--;
  }
  for (int k = i; k < j + 1; k++) {
    if (S[k] == '.' && B) {
      W++;
    } else if (S[k] == '#') {
      B++;
    }
  }
  cout << min(B, W) << endl;
  return 0;
}
