#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  string S;
  cin >> S;
  int res = 0, l = 0, r = N - 1;
  while (l < r) {
    while (l < N - 1 && S[l] == '.') {
      l++;
    }
    while (r > 0 && S[r] == '#') {
      r--;
    }
    if (l != r) res++;
    l++, r--;
  }
  cout << res << '\n';
  return 0;
}
