#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned int N;
  string S;
  cin >> N;
  cin >> S;
  bool flagB = false;
  bool flagW = false;
  unsigned int countB = 0;
  unsigned int countW = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#' && !flagB) {
      flagB = true;
    }
    if (S[i] == '.' && !flagW) {
      flagW = true;
    }
    if (flagB && S[i] == '.') {
      countW++;
    }
    if (flagW && S[i] == '#') {
      countB++;
    }
  }
  cout << min(countB, countW);
}
