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