#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  bool b = false;
  int cnt = 0, black = 0;
  for (int i = 0; i < N; ++i) {
    if (b && S[i] == '.') cnt++;
    if (S[i] == '#') {
      b = true;
      black++;
    }
  }
  cout << min(cnt, black) << "\n";
  return 0;
}
