#include <bits/stdc++.h>
using namespace std;
using namespace std;
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
long long min(long long a, long long b) {
  if (a > b) return b;
  return a;
}
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  fast();
  long long n;
  string s, a;
  s = "0";
  cin >> n;
  cin >> a;
  s += a;
  long long ans = 0;
  long long pos = n + 1;
  for (int i = 1; i <= n; i++) {
    if (s[i] == '#') {
      pos = i;
      break;
    }
  }
  for (int i = pos; i <= n; i++)
    if (s[i] == '.') ans++;
  ans = min(ans, n - ans);
  long long res = 0;
  pos = 0;
  for (int i = n; i >= 1; i--) {
    if (s[i] == '.') {
      pos = i;
      break;
    }
  }
  for (int i = pos; i >= 1; i--) {
    if (s[i] == '#') res++;
  }
  res = min(res, n - res);
  ans = min(ans, res);
  cout << ans << endl;
  return 0;
}
