#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int stop = 1;
  int ans = 0;
  int count = 0;
  for (int i = 0; i < N; i++) {
    if (stop) {
      if (S[i] == '#') {
        stop = 0;
      } else {
        count++;
      }
    } else if (S[i] == '.') {
      ans += 1;
    }
  }
  int alt = N - count - ans;
  cout << min(ans, alt) << endl;
}
