#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int ans = 0;
  bool flag = true;
  int x;
  cin >> N;
  char S[N];
  cin >> S;
  for (int i = 0; i < N; i++) {
    if (strncmp(&S[i], "#", 1) == 0) {
      if (strncmp(&S[i + 1], ".", 1) == 0) {
        ans += 1;
        S[i * 1] = '#';
      }
      if (flag) {
        x = i;
        flag = false;
      }
    }
  }
  if (2 * ans < N) {
    cout << ans << endl;
  } else {
    cout << N - ans - x << endl;
  }
  return 0;
}
