#include <bits/stdc++.h>
using namespace std;
int N;
int main(void) {
  cin >> N;
  char S[N];
  cin >> S;
  int first = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      first = i;
      break;
    }
  }
  int cnt0 = 0;
  int cnt1 = 0;
  bool flag = false;
  int i = first;
  while (true) {
    while (S[i] == '#') {
      i++;
      cnt0++;
      if (i == N) {
        flag = true;
        break;
      }
    }
    while (S[i] == '.') {
      i++;
      cnt1++;
      if (i == N) {
        flag = true;
        break;
      }
    }
    if (flag) {
      break;
    }
  }
  cout << min(cnt0, cnt1) << endl;
}
