#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll amari = 1e9 + 7;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int w[n];
  int b[n];
  b[0] = 0;
  for (int i = 1; i < n; i++) {
    if (s[i] == '#')
      b[i] = b[i - 1] + 1;
    else
      b[i] = b[i - 1];
  }
  w[n - 1] = 0;
  for (int i = n - 2; i >= 0; i--) {
    if (s[i] == '.')
      w[i] = w[i + 1] + 1;
    else
      w[i] = w[i - 1];
  }
  int mini = 99999999;
  for (int i = 0; i < n; i++) {
    mini = min(mini, b[i] + w[i]);
  }
  cout << mini << endl;
  return 0;
}
