#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  int sum[n];
  int a = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      a++;
      sum[i] = a;
    } else
      sum[i] = a;
  }
  int b;
  a = 0;
  int ans = n;
  if (sum[n - 1] == 0 || sum[n - 1] == n)
    cout << "0" << endl;
  else {
    for (int i = 0; i < n; i++) {
      a = sum[i];
      if (i != n - 1) {
        b = (n - i - 1) - (sum[n - 1] - sum[i]);
      } else {
        b = s[i] == '#' ? 0 : 1;
      }
      ans = min(ans, a + b);
    }
    cout << ans << endl;
  }
}
