#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans;
  ans = n;
  int i = n - 1;
  int temp = 0;
  int ans_temp = 0;
  for (i; i > 0; i--) {
    if (s[i] == '.' && s[i - 1] == '#') {
      temp = i;
      break;
    }
  }
  int j;
  for (j = 0; j < temp; j++) {
    if (s[j] == '#') {
      ans_temp++;
    }
  }
  if (ans > ans_temp) {
    ans = ans_temp;
    ans_temp = 0;
  }
  for (j = 0; j < n; j++) {
    if (s[j] == '.') {
      ans_temp++;
    }
  }
  if (ans > ans_temp) {
    ans = ans_temp;
    ans_temp = 0;
  }
  for (j = 0; j < n; j++) {
    if (s[j] == '#') {
      ans_temp++;
    }
  }
  if (ans > ans_temp) {
    ans = ans_temp;
    ans_temp = 0;
  }
  cout << ans;
  return 0;
}
