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