#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int ans = 0, count = 0;
  vector<int> e;
  char b = '#';
  char w = '.';
  for (int i = 0; i < N; i++) {
    if (S[i] == b) {
      count++;
    }
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == b) {
      if (count < N - i - count) {
        ans++;
        count--;
      } else {
        ans += N - i - count;
        break;
      }
    }
  }
  cout << ans << endl;
}
