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