#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int ans1 = 0, ans2 = 0;
  int dotflag = 0;
  int sharpflag = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      sharpflag = 1;
    }
    if (S[i] == '.' && sharpflag == 1) ans1++;
  }
  for (int i = 0; i < N; i++) {
    if (S[N - i - 1] == '.') {
      dotflag = 1;
    }
    if (S[N - i - 1] == '.' && sharpflag == 1) ans2++;
  }
  cout << min(ans1, ans2) << endl;
  return 0;
}
