#include <bits/stdc++.h>
using namespace std;
int main() {
  long long count = 0, cou = 0, N, a, b;
  string S;
  cin >> N >> S;
  for (long long i = 0; i < N; i++) {
    if (S.at(i) == '#') {
      for (long long j = i; j < N; j++) {
        if (S.at(j) == '.') {
          count++;
        } else {
          cou++;
        }
      }
      break;
    }
  }
  b = N - cou;
  if (S.at(N - 1) == '#' && cou != 0) {
    cou--;
  }
  a = min(count, cou);
  a = min(b, a);
  cout << a;
}
