#include <bits/stdc++.h>
using namespace std;
int main() {
  long N;
  string s;
  cin >> N;
  cin >> s;
  long a = 0;
  int flag = 0;
  long b = 0;
  for (long i = 0; i < N; i++) {
    if (s[i] == '#' && flag == 0) {
      flag = 1;
    }
    if (flag == 1) {
      if (s[i] == '.') {
        a++;
      } else {
        b++;
      }
    }
  }
  if (a == N || a == 0) {
    cout << '0' << endl;
  } else if (a <= b) {
    cout << a << endl;
  } else {
    cout << b << endl;
  }
  return 0;
}
