#include <bits/stdc++.h>
using namespace std;
vector<int> x;
int c[100001];
int main(int, char**) {
  long long a, w = 0, b = 0, ans = 0;
  string s;
  cin >> a >> s;
  c[0] = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '#') {
      b++;
    } else {
      w++;
    }
    c[i + 1] = b;
  }
  ans = a - c[a];
  for (int i = 0; i <= s.length(); i++) {
    long long x = c[i] + (a - i) - (c[a] - c[i]);
    ans = min(ans, x);
  }
  cout << ans << endl;
  return 0;
}
