#include <bits/stdc++.h>
using namespace std;
using p = pair<long long, long long>;
long long dx[8] = {0, 1, 0, -1, 1, 1, -1, -1};
long long dy[8] = {1, 0, -1, 0, 1, -1, 1, -1};
int main(void) {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  vector<long long> a(n, 0), b(n, 0);
  if (s[0] == '.') a[0] = 1;
  if (s[0] == '#') b[0] = 1;
  for (long long i = 1; i < n; i++) {
    if (s[i] == '.')
      a[i] = a[i - 1] + 1;
    else
      a[i] = a[i - 1];
    if (s[i] == '#')
      b[i] = b[i - 1] + 1;
    else
      b[i] = b[i - 1];
  }
  long long now = 0;
  long long ans = min(a[n - 1], n - a[n - 1]);
  for (long long i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      ans = min(ans, now + a[n - 1] - a[i]);
      now = b[i];
    }
  }
  cout << ans << endl;
  return 0;
}
