#include <bits/stdc++.h>
using namespace std;
const int inf = 2000000;
const int mod = 998244353;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int a, b;
  bool flag = false;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.' && flag) {
      a++;
    }
    if (S[i] == '#') {
      flag = true;
      b++;
    }
  }
  if (a < b) {
    cout << a << endl;
  } else {
    cout << b << endl;
  }
  return 0;
}
