#include <bits/stdc++.h>
using namespace std;
long long dx[4] = {1, 0, -1, 0};
long long dy[4] = {0, 1, 0, -1};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  long long a, b;
  long long k, t;
  string str;
  long long h, w;
  char c, ko;
  cin >> n >> str;
  n = str.length();
  a = 0;
  k = 0;
  for (long long i = (long long)(0); i < (long long)(n); i++) {
    if (str[i] == '.')
      a++;
    else
      k++;
  }
  long long sum = min(a, k);
  reverse((str).begin(), (str).end());
  b = 0;
  w = 0;
  for (long long i = (long long)(0); i < (long long)(n); i++) {
    if (str[i] == '#') b++;
    sum = min(sum, k - b + a);
  }
  cout << sum << endl;
  return 0;
}
