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