#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  char data[n];
  for (long long i = 0; i < n; i++) cin >> data[i];
  if (n == 1) {
    cout << "0" << endl;
    return 0;
  }
  bool point = true;
  for (long long i = 1; i < n; i++)
    if (data[i] != data[i - 1]) point = false;
  if (point) {
    cout << "0" << endl;
    return 0;
  }
  long long black[n];
  long long white[n];
  long long min = 100000000000;
  if (data[0] == '#')
    black[0] = 1;
  else
    black[0] = 0;
  if (data[n - 1] == '.')
    white[n - 1] = 1;
  else
    white[n - 1] = 0;
  for (long long i = 1; i < n; i++) {
    if (data[i] == '#')
      black[i] = black[i - 1] + 1;
    else
      black[i] = black[i - 1];
  }
  for (long long i = n - 2; i >= 0; i--) {
    if (data[i] == '.')
      white[i] = white[i + 1] + 1;
    else
      white[i] = white[i + 1];
  }
  for (long long i = 0; i < n; i++) {
    if (min > black[i] + white[n - 1 - i]) min = black[i] + white[n - 1 - i];
  }
  cout << min << endl;
}
