#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  string s;
  cin >> n >> s;
  vector<int> W(n + 1), B(n + 1);
  for (int i = (int)0; i < (int)n; ++i) {
    if (s[i] == '#')
      B[i + 1] = B[i] + 1;
    else
      B[i + 1] = B[i];
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.')
      W[i] = W[i + 1] + 1;
    else
      W[i] = W[i + 1];
  }
  int ans = (1 << 30);
  for (int i = (int)0; i < (int)n; ++i) ans = min(ans, W[i] + B[i]);
  cout << ans << '\n';
  return 0;
}
