#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int i, j, a, b;
  cin >> a;
  string s;
  cin >> s;
  int frag1 = 0;
  int frag2 = 0;
  int white = 0;
  int black = 0;
  for (i = 0; i < a; i++) {
    if (s[i] == '#') frag1 = 1;
    if (frag1 == 1) {
      if (s[i] == '.') white++;
    }
    if (s[i] == '.') {
      black = black + frag2;
      frag2 = 0;
    }
    if (s[i] == '#') frag2++;
  }
  if (black > white)
    cout << white << endl;
  else
    cout << black << endl;
}
