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