#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int flag = -1;
  int cntw = 0;
  int cntb = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#') {
      cntb++;
    } else
      cntw++;
  }
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#') {
      flag = i;
      break;
    }
  }
  if (flag == -1) {
    cout << 0 << endl;
    return 0;
  }
  int cnt = 0;
  for (int i = flag; i < N; i++) {
    if (S.at(i) == '.') {
      cnt++;
    }
  }
  int endb = 0;
  for (int i = N - 1; i >= 0; i--) {
    if (S.at(i) == '#') {
      endb++;
    } else
      break;
  }
  int cnt2 = 0;
  for (int i = flag; i < N - endb; i++) {
    if (S.at(i) == '#') {
      cnt2++;
    }
  }
  int ans = 0;
  ans = min(min(min(cnt, cnt2), cntb), cntw);
  cout << ans << endl;
  return 0;
}
