#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string s;
  cin >> N >> s;
  int white = 0;
  int black = 0;
  for (int i = 0; i < N; i++) {
    if (s[i] == '.')
      white++;
    else if (s[i] == '#')
      black++;
  }
  int i = 0;
  while (s[i] == '.') {
    white--;
    i++;
  }
  int MIN = min(white, black);
  if (white >= 0)
    cout << MIN << endl;
  else
    cout << 0 << endl;
}
