#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int idx = 0;
  while (idx < N) {
    if (S[idx] != '.') {
      break;
    }
    idx += 1;
  }
  while (idx < N) {
    if (S[idx] != '#') {
      break;
    }
    idx += 1;
  }
  if (idx == N) {
    cout << 0 << endl;
    return 0;
  }
  int left_out = 0;
  int flag = 1;
  int left_idx = 0;
  int right_idx = N - 1;
  while (1) {
    if (left_idx == right_idx) {
      break;
    }
    if (flag) {
      if (S[left_idx] == '#') {
        left_out += 1;
        flag = 0;
      }
      left_idx += 1;
    } else {
      if (S[right_idx] == '.') {
        left_out += 1;
        flag = 1;
      }
      right_idx -= 1;
    }
  }
  int right_out = 0;
  flag = 0;
  left_idx = 0;
  right_idx = N - 1;
  while (1) {
    if (left_idx == right_idx) {
      break;
    }
    if (flag) {
      if (S[left_idx] == '#') {
        right_out += 1;
        flag = 0;
      }
      left_idx += 1;
    } else {
      if (S[right_idx] == '.') {
        right_out += 1;
        flag = 1;
      }
      right_idx -= 1;
    }
  }
  if (left_out < right_out) {
    cout << left_out << endl;
  } else {
    cout << right_out << endl;
  }
  return 0;
}
