#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, ans = 0, tmp, j, k, W = 0, B = 0;
  char S[3000000];
  cin >> N;
  for (int i = 1; i <= N; i++) {
    cin >> S[i];
    if (S[i] == '.') {
      W += 1;
    } else {
      B += 1;
    }
  }
  for (int i = 2; i <= N; i++) {
    tmp = 0;
    if (S[i - 1] == '#' && S[i] == '.') {
      j = i - 1;
      k = i;
      while (1) {
        tmp += 1;
        j -= 1;
        k += 1;
        if (S[j] == '.' || S[k] == '#' || j == 0 || k == (N + 1)) {
          break;
        }
      }
      i += tmp;
      ans += tmp;
    }
  }
  if (ans < W || ans < B) {
    ans = min(W, B);
  }
  cout << ans;
  return 0;
}
