#include <bits/stdc++.h>
using namespace std;
template <typename T>
void printVec(vector<T> &v) {
  for (long long i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << endl;
}
signed main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  vector<long long> b(n + 1, 0);
  if (s[0] == '#') b[1]++;
  for (long long i = 2; i < n + 1; i++) {
    if (s[i] == '#')
      b[i] = b[i - 1] + 1;
    else
      b[i] = b[i - 1];
  }
  vector<long long> w(n + 1, 0);
  if (s[n - 1] == '.') w[n - 1]++;
  for (long long i = n - 2; i >= 0; i--) {
    if (s[i] == '.')
      w[i] = w[i + 1] + 1;
    else
      w[i] = w[i + 1];
  }
  long long ans = 1000000000000;
  for (long long i = 0; i < n + 1; i++) {
    ans = min(ans, w[i] + b[i]);
  }
  cout << ans << endl;
  return 0;
}
