#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n, i, j, k;
  vector<int> a, b;
  cin >> n;
  cin >> s;
  (a).resize(n + 1);
  a[0] = 0;
  for (i = 1; i < n + 1; i++) {
    if (s[i - 1] == '#')
      a[i] = a[i - 1] + 1;
    else
      a[i] = a[i - 1];
  }
  (b).resize(n + 1);
  b[0] = 0;
  for (i = 1; i < n + 1; i++) {
    if (s[n - i] == '.')
      b[i] = b[i - 1] + 1;
    else
      b[i] = b[i - 1];
  }
  k = n + 2;
  for (i = 1; i < n + 1; i++) {
    k = min(a[i] + b[n - i], k);
  }
  cout << k;
  return 0;
}
