#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  unsigned int N, answer;
  cin >> N >> S;
  unsigned int count_sharp, count_dot;
  count_sharp = 0;
  count_dot = 0;
  unsigned int sharp_dot_location_left;
  unsigned int sharp_dot_location_right;
  for (int i = 0; i < N - 1; i++) {
    if (S.at(i) == '#' && S.at(i + 1) == '.') {
      sharp_dot_location_left = i;
      break;
    }
  }
  for (int i = N - 1; i > 0; i--) {
    if (S.at(i - 1) == '#' && S.at(i) == '.') {
      sharp_dot_location_right = i;
      break;
    }
  }
  for (int i = sharp_dot_location_right; i >= 0; i--) {
    if (S.at(i) == '#') count_sharp++;
  }
  for (int i = sharp_dot_location_left; i < N; i++) {
    if (S.at(i) == '.') count_dot++;
  }
  if (count_sharp > count_dot) {
    answer = count_dot;
  } else {
    answer = count_sharp;
  }
  cout << answer << endl;
  return 0;
}
