#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans = n;
  int t = 0;
  vector<int> a(n, 0), b(n, 0);
  for (long long int i = 0; i < n; ++i) {
    if (s[i] == '#') {
      t++;
    }
    b[i] = t;
  }
  t = 0;
  for (long long int i = 0; i < n; ++i) {
    if (s[n - i - 1] == '.') {
      t++;
    }
    a[n - i - 1] = t;
  }
  if (b.back() == n || a[0] == n) {
    cout << 0 << endl;
    return 0;
  }
  for (long long int i = 0; i < n - 1; ++i) {
    ans = min(ans, a[i + 1] + b[i]);
  }
  cout << ans << endl;
  return 0;
}
