#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
int points[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
    } else {
      points[i + 1]++;
    }
  }
  int ans = INT_MAX;
  for (int i = 1; i <= n; i++) {
    points[i] += points[i - 1];
  }
  for (int i = 1; i <= n; i++) {
    int left = i - points[i];
    int right = points[n] - points[i];
    ans = min(ans, right + left);
  }
  cout << ans << "\n";
  return 0;
}
