#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, black = 0, white = 0;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '.')
      white++;
    else
      black++;
  }
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '.')
      white--;
    else
      break;
  }
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#')
      black--;
    else
      break;
  }
  cout << min(black, white) << endl;
  return 0;
}
