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