#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  vector<long long> dot(n), h(n);
  if (s[0] == '#') h[0] = 1;
  if (s[n - 1] == '.') dot[n - 1] = 1;
  for (long long i = 1; i < n; i++) {
    h[i] = h[i - 1] + (s[i] == '#');
  }
  for (long long i = n - 2; i >= 0; i--) dot[i] = dot[i + 1] + (s[i] == '.');
  long long ans = min(h[n - 1], dot[0]);
  for (long long i = 1; i < n - 1; i++) ans = min(ans, h[i] + dot[i + 1]);
  cout << ans;
}
