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